(function() {
	var MERGE_MODS = {
		"assets/lib/lodash/1.0/main": function() {
			define(function() {
				"use strict";
				return _
			});
		},
		"assets/lib/jquery/1.0/main": function() {
			define(function() {
				"use strict";
				return jQuery.event.special.swipe.horizontalDistanceThreshold = 100,
				jQuery
			});
		},
		"assets/js/util/json": function() {
			define(function(require, exports, module) {
				"use strict";
				return {
					parse: function(txt) {
						return txt && eval("(" + txt + ")")
					},
					stringify: function(t) {
						return JSON.stringify(t)
					}
				}
			});
		},
		"assets/js/lang/data-store": function() {
			define(function(require) {
				"use strict";
				var t = require("$"),
				n = require("_"),
				e = require("util/json"),
				i = t("#doc").data(),
				c = t("#content").data(),
				r = {},
				u = /^\{.*\}$/m;
				return t.extend(r, i, c),
				n.each(r,
				function(t, i) {
					n.isString(t) && u.test(t) && (r[i] = e.parse(t))
				}),
				{
					get: function(t) {
						return t && r[t] || r
					},
					set: function(t, n) {
						r[t] = n
					}
				}
			});
		},
		"assets/js/util/cookie": function() {
			define(function(require) {
				"use strict";
				var e = require("_");
				return {
					set: function(t, n, o) {
						var r = "";
						if (null != o) {
							var i = new Date(e.now() + 24 * o * 3600 * 1e3);
							r = i.toUTCString()
						}
						var c = [t + "=" + encodeURIComponent(n), "expires=" + r, "domain=www.jiaoyidaren.com", "path=/"];
						return document.cookie = c.join("; "),
						this
					},
					get: function(t) {
						var n = document.cookie.split("; "),
						o = "";
						return t += "=",
						e.each(n,
						function(n) {
							return e.startsWith(n, t) ? (o = n.replace(t, ""), !1) : void 0
						}),
						o && decodeURIComponent(o)
					},
					remove: function(e) {
						return this.set(e, "", -1),
						this
					}
				}
			});
		},
		"assets/js/biz/page/trade/base": function() {
			define(function(require) {
				"use strict";
				var t = require("_"),
				e = require("dataStore"),
				o = require("util/cookie"),
				i = e.get("config"),
				s = i.BASE = {},
				u = i.QTCONFIG = {};
				if (i.tradeList.forEach(function(e) {
					e.priceUnit = parseFloat(e.priceUnit);
					e.priceDigit = parseFloat(e.priceDigit);
					s[e.commCode] = t.extend({
						unitPrice: e.priceUnit,
						scale: e.priceDigit
					},e),
					e.minuteList && (u[e.commCode] = {
						state: 0,
						lot: e.minuteList[e.minuteCur],
						rate: e.rateList[e.minuteCur]
					})
				}), t.keys(u).length) {
					o.remove("PSCV");
				}
				i.base = {},
				i.qtConfig = {}
			});
		},
		"assets/js/lang/log": function() {
			define(function() {
				"use strict";
				var n = !!window.console,
				o = function() {
					n && console.log.apply(console, arguments)
				};
				return o.warn = function() {
					n && console.warn.apply(console, arguments)
				},
				o.error = function() {
					n && console.error.apply(console, arguments)
				},
				o
			});
		},
		"assets/js/util/timer": function() {
			define(function() {
				"use strict";
				var n = 0,
				t = {},
				e = window.requestAnimationFrame || window.webkitRequestAnimationFrame ||
				function(n) {
					window.setTimeout(n, 17)
				},
				i = function(n) {
					return "number" == typeof n
				},
				u = function() {
					var n = Object.keys(t);
					if (n.length) {
						var e = Date.now();
						n.forEach(function(n) {
							var i = t[n];
							if (null != i && e - i.time >= i.wait) {
								var u = i.times;
								u > 0 && u--,
								i.fn.call(i.context),
								-1 === u || u > 0 ? (i.time = Date.now(), i.times = u) : (i = null, delete t[n])
							}
						})
					}
				},
				r = function(n) {
					t[n + ""] && delete t[n + ""]
				},
				o = function() {
					u(),
					e(o)
				};
				return o(),
				{
					add: function(e, u, o, a) {
						return 2 === arguments.length ? i(u) ? 100 > u && (a = u, u = 1e3) : (o = u, u = 1e3) : 3 === arguments.length && (i(o) ? (a = o, o = null) : i(u) || (a = o, o = u, u = 1e3)),
						n++,
						t[n + ""] = {
							id: n,
							fn: e,
							wait: u || 1e3,
							context: o,
							times: null != a ? a: -1,
							time: Date.now()
						},
						{
							id: n,
							clear: function() {
								r(this.id)
							}
						}
					},
					one: function(n, t, e) {
						return null == t || i(t) || (e = t, t = 1e3),
						this.add(n, t, e, 1)
					},
					ever: function(n, t, e) {
						return null == t || i(t) || (e = t, t = 1e3),
						this.add(n, t, e, -1)
					},
					async: function(n) {
						return this.add(n, 25, null, 1)
					},
					clear: function(n) {
						null != n && i(n) && r(n)
					}
				}
			});
		},
		"assets/js/ui/msgbox/1.0/main": function() {
			define(function(require) {
				"use strict";
				var i = require("$"),
				n = require("util/timer"),
				t = i("#doc"),
				a = t.find("div.msgbox-info"),
				d = t.find("div.msgbox-confirm"),
				o = t.find("div.msgbox-toast"),
				s = null,
				e = null,
				l = null,
				v = null,
				c = function() {
					f(),
					r()
				},
				f = function() {
					var n = t.find("div.float"),
					s = n.children("div.content");
					n.length || (t.append('<div class="float"><div class="content"></div></div>'), n = t.find("div.float"), s = n.children("div.content")),
					a.length || (a = i('<div class="overlay-top msgbox msgbox-info hide"><div class="content"><div class="main"></div><div class="action"><a href="javascript:void(0)" class="button ok">确定</a></div></div></div>').appendTo(s)),
					d.length || (d = i('<div class="overlay-top msgbox msgbox-confirm hide"><div class="content"><div class="main"></div><div class="action clearfix"><div class="left"><a href="javascript:void(0)" class="button button-lesser no">取消</a></div><div class="right"><a href="javascript:void(0)" class="button ok">确定</a></div></div></div></div>').appendTo(s)),
					o.length || (o = i('<div class="msgbox-toast hide"><div class="content"></div></div>').appendTo(s))
				},
				r = function() {
					var n = function(n) {
						n.preventDefault();
						var t = i(this);
						if (!t.hasClass("button-disabled")) {
							if ( - 1 === t.attr("href").indexOf("javascript:void(0)")) return void(window.location.href = t.attr("href"));
							g(),
							s && s.call(this)
						}
					},
					t = function(n) {
						n.preventDefault();
						var t = i(this);
						if (!i(this).hasClass("button-disabled")) {
							if ( - 1 === t.attr("href").indexOf("javascript:void(0)")) return void(window.location.href = t.attr("href"));
							g(),
							e && e.call(this)
						}
					};
					a.find("div.action a.ok").on("tap", n),
					d.find("div.action a.ok").on("tap", n),
					d.find("div.action a.no").on("tap", t)
				},
				u = function(i) {
					var n = a.find("div.action a.ok"),
					t = "确定",
					d = "javascript:void(0)";
					i && i.ok && (t = i.ok.name || t, d = i.ok.url || d),
					n.text(t).attr("href", d)
				},
				h = function(i) {
					var n = d.find("div.action a.ok"),
					t = d.find("div.action a.no"),
					a = "确定",
					o = "javascript:void(0)",
					s = "取消",
					e = "javascript:void(0)";
					i && i.ok && (a = i.ok.name || a, o = i.ok.url || o),
					i && i.no && (s = i.no.name || s, e = i.no.url || e),
					n.text(a).attr("href", o),
					t.text(s).attr("href", e)
				},
				m = function(i, n, t) {
					s = n,
					e = null,
					i && (l = a.find("div.main").html(), a.find("div.main").html(i)),
					u(t),
					a.removeClass("hide")
				},
				b = function(i, n, t, a) {
					s = n,
					e = t,
					i && (v = d.find("div.main").html(), d.find("div.main").html(i)),
					h(a),
					d.removeClass("hide")
				},
				p = 0,
				x = function(i) {
					i && (o.children("div.content").text(i), o.removeClass("hide"), n.clear(p), p = n.one(function() {
						o.animate({
							opacity: 0
						},
						500,
						function() {
							o.addClass("hide").css({
								opacity: 1
							})
						})
					},
					2500).id)
				},
				g = function() {
					a.addClass("hide"),
					d.addClass("hide"),
					o.addClass("hide"),
					l && a.find("div.main").html(l),
					v && d.find("div.main").html(v)
				};
				return c(),
				{
					alert: function(i, n, t) {
						return "function" == typeof i && (t = n, n = i, i = null),
						m(i, n, t),
						this
					},
					confirm: function(i, n, t, a) {
						return "function" == typeof i && (a = t, t = n, n = i, i = null),
						b(i, n, t, a),
						this
					},
					toast: function(i) {
						x(i)
					},
					disable: function() {
						return a.find("div.action > a.button").addClass("button-disabled"),
						d.find("div.action > a.button").addClass("button-disabled"),
						this
					},
					enable: function() {
						return a.find("div.action > a.button").removeClass("button-disabled"),
						d.find("div.action > a.button").removeClass("button-disabled"),
						this
					}
				}
			});
		},
		"assets/js/ui/loading/1.0/main": function() {
			define(function(require) {
				"use strict";
				var i = require("$"),
				n = i("#doc"),
				d = '<div class="loading hide"><div class="content"><img src="//www.jiaoyidaren.com/Public/Home/assets/imgs/loading/01.gif"/></div></div>',
				s = 0,
				e = null,
				t = function() {
					if (!e) {
						var s = n.find("div.float");
						s[0] || (s = i('<div class="float"><div class="content"></div></div>').appendTo(n)),
						e = i(d).appendTo(s.children("div.content"))
					}
				};
				return t(),
				{
					show: function(i) {
						return i === !0 ? s = -1 : s > -1 && s++,
						e.removeClass("hide"),
						this
					},
					hide: function(i) {
						return i === !0 ? s = 0 : s > 0 && s--,
						0 === s && e.addClass("hide"),
						this
					}
				}
			});
		},
		"assets/js/biz/mod/ajax-result": function() {
			define(function(require) {
				"use strict";
				var r = require("log"),
				o = require("ui/msgbox"),
				t = require("ui/loading"),
				n = function(r) {
					return "function" == typeof r
				},
				e = function(r, t) {
					var e = r.redirectUrl,
					i = r.errorMsg,
					a = r.msgType,
					c = r.button;
					if (e && /^>/.test(e)) return void(window.location.href = e.substring(1));
					if (e && /^\*/.test(e)) switch (e = e.replace("*", "")) {
					case "refresh":
						window.location.reload()
					} else {
						var f = function() {
							e ? window.location.href = e: n(t) && t()
						};
						i ? c ? c.ok && c.no ? o.confirm(i, f, null, c) : o.alert(i, f, c) : e ? o.alert(i, f) : "toast" === a ? (o.toast(i), f()) : o.alert(i, f) : f()
					}
				};
				return {
					done: function(r, o) {
						e(r, o)
					},
					fail: function(o, n) {
						r.error(n),
						t.hide(!0),
						e({
							errorMsg: "抱歉，系统繁忙，请稍后再试"
						})
					}
				}
			});
		},
		"assets/js/lang/net": function() {
			define(function(require) {
				"use strict";
				var t = require("$"),
				e = require("util/json"),
				n = require("mod/ajax-result"),
				r = function(e) {
					this.jqXHR = t.ajax(e)
				};
				return r.prototype = {
					done: function(t) {
						return this.jqXHR.done(t),
						this
					},
					fail: function(t) {
						return this.jqXHR.fail(t),
						this
					},
					complete: function(t) {
						return this.jqXHR.complete(t),
						this
					},
					always: function(t) {
						return this.jqXHR.always(t),
						this
					}
				},
				{
					post: function(t) {
						return t.type = "POST",
						this.ajax(t)
					},
					get: function(t) {
						return t.type = "GET",
						this.ajax(t)
					},
					jsonp: function(t) {
						return t.type = "GET",
						t.dataType = "jsonp",
						this.ajax(t)
					},
					ajax: function(t) {
						return t.type = t.type || "POST",
						t.cache = t.cache || !1,
						t.dataType = t.dataType || "json",
						t.success = t.success || n.done,
						t.error = t.error || n.fail,
						t.converters = {
							"text json": function(t) {
								return e.parse(t && t.replace(/[\n\r]/g, " "))
							}
						},
						new r(t)
					}
				}
			});
		},
		"assets/js/util/strings": function() {
			define(function() {
				"use strict";
				return {
					format: function() {
						var n = /\$\w+|\$\{\w+\}/g,
						r = /\$|\{|\}/g,
						t = function(n) {
							return n.replace(r, "")
						};
						return function(r, u) {
							return r.replace(n,
							function(n) {
								var r = u[t(n)];
								return null == r ? n: r
							})
						}
					} (),
					tpl: function(n) {
						var r = this;
						return function(t) {
							return r.format(n, t)
						}
					}
				}
			});
		},
		"assets/js/util/dates": function() {
			define(function() {
				"use strict";
				var e = function(e, r) {
					return (!r && 10 > e ? "0": "") + e
				};
				return {
					format: function(r, t, a) {
						t = t || "Y-M-D h:m:s";
						for (var c = r.getTime ? r: new Date(r), n = t.length, g = t, s = 0; n > s; s++) switch (t.charAt(s)) {
						case "Y":
							g = g.replace(/Y/g, e(c.getFullYear(), a));
							break;
						case "y":
							g = g.replace(/y/g, e(c.getFullYear(), a).substring(2));
							break;
						case "M":
							g = g.replace(/M/g, e(c.getMonth() + 1, a));
							break;
						case "D":
							g = g.replace(/D/g, e(c.getDate(), a));
							break;
						case "h":
							g = g.replace(/h/g, e(c.getHours(), a));
							break;
						case "m":
							g = g.replace(/m/g, e(c.getMinutes(), a));
							break;
						case "s":
							g = g.replace(/s/g, e(c.getSeconds(), a))
						}
						return g
					},
					prevMinute: function(r) {
						if ("string" == typeof r ? r = r.replace(":", "") - 0 : r.getTime && (r = r.getTime()), r > 2359) return this.format(new Date(r - 6e4), "h:m");
						var t = r / 100 | 0,
						a = r % 100;
						return a -= 1,
						0 > a && (a = 59, t -= 1),
						0 > t && (t = 23),
						e(t) + ":" + e(a)
					}
				}
			});
		},
		"assets/js/util/guid": function() {
			define(function() {
				"use strict";
				var r = "0Aa1Bb2Cc3Dd4Ee5Ff6Gg7Hh8Ii9Jj0Kk1Ll2Mm3Nn4Oo5Pp6Qq7Rr8Ss9Tt0Uu1Vv2Ww3Xx4Yy5Zz6789",
				t = r.length,
				n = 20;
				return {
					get: function(e) {
						e && "number" == typeof e || (e = n);
						for (var u = ""; e-->0;) u += r.charAt(Math.random() * t | 0);
						return u
					}
				}
			});
		},
		"assets/js/lang/observer": function() {
			define(function() {
				"use strict";
				var t = {}.toString,
				r = Array.prototype.slice,
				e = function(r) {
					return "[object Function]" === t.call(r)
				},
				o = Array.isArray ||
				function(r) {
					return "[object Array]" === t.call(r)
				},
				n = function(t) {
					return "string" == typeof t
				},
				i = function(t, r) {
					var e;
					if (o(t)) for (; e = t.shift();) r(e);
					else r(t)
				},
				c = function(t, r, e, o) {
					if (n(r)) {
						var i = t[r] || (t[r] = []);
						i.push({
							listener: e,
							context: o
						})
					}
				},
				s = function(t, r, e, o) {
					var i, c;
					if (n(r) && (i = t[r])) if (e || o) for (var s = 0,
					u = i.length; u > s;) c = i[s],
					e && c.listener === e || o && c.context === o ? i.splice(s, 1) : s++;
					else delete t[r]
				},
				u = function(t, r, e) {
					var o, i;
					if (n(r) && (o = t[r])) for (var c = 0,
					s = o.length; s > c; c++) i = o[c],
					i.listener.apply(i.context || this._observer_context || this, e)
				},
				f = function(t) {
					this._observer_context = t
				};
				f.prototype = {
					attach: function(t, r, o) {
						var n;
						return e(r) ? (n = this._observer_group || (this._observer_group = {}), i(t,
						function(t) {
							c(n, t, r, o)
						}), this) : this
					},
					detach: function(t, r, e) {
						var o;
						return (o = this._observer_group) ? t ? (i(t,
						function(t) {
							s(o, t, r, e)
						}), this) : (delete this._observer_group, this) : this
					},
					notify: function(t) {
						var e, o, n;
						return (e = this._observer_group) ? (o = r.call(arguments, 1), n = this, i(t,
						function(t) {
							u.call(n, e, t, o)
						}), this) : this
					}
				},
				f.prototype.on = f.prototype.attach,
				f.prototype.off = f.prototype.detach,
				f.prototype.emit = f.prototype.notify;
				var a = new f(window);
				return a.create = function(t) {
					return new f(t)
				},
				a.mixTo = function(t) {
					t = t || {};
					var r = f.prototype;
					for (var e in r) t[e] = r[e];
					return t
				},
				a
			});
		},
		"assets/js/biz/mod/observer": function() {
			define(function(require) {
				"use strict";
				var e = require("lang/observer");
				return e.create()
			});
		},
		"assets/js/lang/class": function() {
			define(function() {
				"use strict";
				var t = function(t, n) {
					var r, o;
					for (o in n) r = n[o],
					void 0 !== r && (t[o] = r);
					return t
				},
				n = function() {};
				return function(r, o) {
					o || (o = r, r = null);
					var i, e = function() {
						this.init && this.init.apply(this, arguments)
					},
					p = {};
					return r && (n.prototype = i = r.prototype || r, p = new n),
					e.prototype = t(p, o),
					e.prototype.constructor = e,
					e.prototype.superclass = i,
					e
				}
			});
		},
		"assets/js/ui/menu/1.0/main": function() {
			define(function(require) {
				"use strict";
				var i = require("$"),
				t = require("_"),
				s = require("class"),
				e = '<div class="overlay-top msgbox menu-pop hide"><div class="content"><div class="main"><ul></ul></div></div></div>',
				n = '<div class="overlay-top msgbox menu-slideup hide"><div class="content"><div class="main"><div class="tips text-lesser text-s hide"><p></p></div><ul></ul><div class="action"><a href="javascript:void(0)">取消</a></div></div></div></div>',
				a = '<div class="overlay-top msgbox menu-slidedown hide"><div class="content"><div class="main"><ul></ul></div></div></div>',
				d = i(window),
				l = i("#doc"),
				o = s({
					init: function(i, t) {
						this.menu = null,
						this.data = i,
						this.tpl = t || e,
						this.callbacks = null,
						this.render(),
						this.wait()
					},
					render: function() {
						var t = l.find("div.float"),
						s = t.children("div.content");
						t[0] || (l.append(i('<div class="float"><div class="content"></div></div>')), t = l.find("div.float"), s = t.children("div.content")),
						this.menu || (this.menu = i(this.tpl).appendTo(s)),
						this._html()
					},
					wait: function() {
						var t = this;
						this.menu.find("ul").on("tap", "li",
						function(s) {
							s.preventDefault(),
							s.stopPropagation(),
							t.hide();
							var e = t.callbacks;
							if (e) {
								var n, a, d = i(this);
								"function" == typeof e ? n = e: (n = e[0], a = e[1]),
								n && n(d.text(), d.data("value"), d.data()),
								a && a()
							}
						}),
						this.menu.on("tap",
						function(i) {
							i.preventDefault(),
							i.stopPropagation(),
							t.hide();
							var s = t.callbacks;
							s && s[1] && s[1]()
						})
					},
					show: function(i) {
						this.callbacks = i,
						this.menu.removeClass("hide")
					},
					hide: function() {
						this.menu.addClass("hide")
					},
					isShow: function() {
						return ! this.menu.hasClass("hide")
					},
					load: function(i) {
						this.data = i,
						this._html()
					},
					_html: function() {
						var i = "";
						this.data && this.data.forEach(function(s) {
							var e = "",
							n = s;
							t.isObject(s) ? (t.each(s,
							function(i, t) {
								"name" !== t && (e += " data-" + t + '="' + i + '"')
							}), n = s.name) : e = ' data-value="' + s + '"',
							i += "<li" + e + ">" + n + "</li>"
						}),
						this.menu.find("ul").html(i)
					}
				});
				return o.SlideUp = s(o, {
					init: function(i) {
						this.superclass.init.call(this, i, n)
					},
					render: function() {
						this.superclass.render.call(this);
						var i = .84 * d.height() / 100;
						this.menu.find("ul").css("max-height", i + "rem")
					},
					wait: function() {
						this.superclass.wait.call(this);
						var i = this;
						this.menu.find("div.action > a").on("tap",
						function(t) {
							t.preventDefault(),
							i.hide()
						})
					},
					show: function(i) {
						var t = this.menu;
						return this.callbacks = i,
						t.removeClass("hide"),
						setTimeout(function() {
							t.addClass("menu-fade-in"),
							t.children("div.content").removeClass("slide-out"),
							t.children("div.content").addClass("slide-in")
						},
						16),
						this
					},
					hide: function() {
						var i = this.menu;
						return i.children("div.content").removeClass("slide-in"),
						i.children("div.content").addClass("slide-out"),
						i.removeClass("menu-fade-in").addClass("menu-fade-out"),
						setTimeout(function() {
							i.addClass("hide").removeClass("menu-fade-out")
						},
						300),
						this
					},
					setTips: function(i) {
						var t = this.menu.find("div.tips");
						return i && t.removeClass("hide").find("p").text(i),
						this
					}
				}),
				o.SlideDown = s(o, {
					init: function(i) {
						this.superclass.init.call(this, i, a)
					},
					render: function() {
						this.superclass.render.call(this);
						var i = .84 * d.height() / 100;
						this.menu.find("ul").css("max-height", i + "rem")
					},
					show: function(i) {
						var t = this.menu;
						return this.callbacks = i,
						t.removeClass("hide"),
						setTimeout(function() {
							t.addClass("menu-fade-in"),
							t.children("div.content").removeClass("slide-out"),
							t.children("div.content").addClass("slide-in")
						},
						16),
						this
					},
					hide: function() {
						var i = this.menu;
						return i.children("div.content").removeClass("slide-in"),
						i.children("div.content").addClass("slide-out"),
						i.removeClass("menu-fade-in").addClass("menu-fade-out"),
						setTimeout(function() {
							i.addClass("hide").removeClass("menu-fade-out")
						},
						300),
						this
					}
				}),
				o
			});
		},
		"assets/js/biz/page/trade/buy": function() {
			define(function(require) {
				"use strict";
				var e = require("$"),
				t = require("_"),
				i = (require("log"), require("net")),
				s = require("dataStore"),
				o = require("util/strings"),
				n = require("util/dates"),
				a = require("util/guid"),
				r = require("mod/observer"),
				u = require("mod/ajax-result"),
				l = require("ui/menu"),
				d = require("ui/msgbox"),
				c = e("#doc"),
				p = c.find("div.page-trade"),
				m = c.find("div.page-buy-highs"),
				f = m.find("section.main-buy-highs"),
				v = s.get("config"),
				h = v.base,
				g = v.qtConfig,
				C = s.get("urlOpen"),
				L = s.get("urlInvestor"),
				_ = {},
				b = !1,
				x = {
					identity: a.get(16),
					tradeType: v.tradeType
				};
				return {
					init: function() {
						this.initElems(),
						this.initMenu(),
						this.wait(),
						this.attach()
					},
					initData: function() {
						t.extend(x, {
							source: "下单",
							commodity: h.commCode,
							contract: h.contCode,
							isBuy: !0,
							price: 0,
							minute: 0,
							money: 0
						})
					},
					initElems: function() {
						var e = f.find("ul.mod-list"),
						t = e.eq(0).children("li"),
						s = e.eq(1).children("li");
						this.elems = {
							trade: t.eq(0).find("div.left"),
							minute: t.eq(1).find("div.right"),
							ratel: t.eq(2).find("div.left>span"),
							rater: t.eq(2).find("div.right>span"),
							money: t.eq(3).find("div.right"),
							trade_dir: f.find("div.action > a.button"),
							instant_buy: s.eq(0).find("span")
						}
					},
					initMenu: function() {
						this.menu = new l
					},
					wait: function() {
						var t = this,
						i = this.elems;
						i.minute.on("tap", "span.lot",
						function(i) {
							i.preventDefault();
							var s = e(this);
							s.hasClass("selected") || (s.siblings("span.lot.selected").removeClass("selected"), s.addClass("selected"), x.minute = s.data("value"), h.minuteCur = s.data("index"), t.updateRate())
						}).on("tap", "span.more-lot",
						function(e) {
							e.preventDefault(),
							t.menu.load(t.c2list(h.minuteList, 1, "秒")),
							t.menu.show(function(e, i, s) {
								h.minuteCur = s.index,
								t.updateMinute(),
								t.updateRate()
							})
						}),
						i.money.on("tap", "span.lot",
						function(i) {
							i.preventDefault();
							var s = e(this);
							s.hasClass("selected") || (s.siblings("span.lot.selected").removeClass("selected"), s.addClass("selected"), x.money = s.data("value"), h.moneyCur = s.data("index"),t.updateMoney())
						}).on("tap", "span.more-lot",
						function(e) {
							e.preventDefault(),
							t.menu.load(t.c2list(h.moneyList, 1, "元")),
							t.menu.show(function(e, i, s) {
								h.moneyCur = s.index,
								t.updateMoney()
							})
						}),
						
						m.find("a.go-back").on("tap",
						function(e) {
							e.preventDefault(),
							m.hide(),
							p.show(),
							x.isBuy = null,
							r.notify("pageSwitch", "page-quote")
						}),
						f.on("swiperight",
						function(e) {
							e.preventDefault(),
							m.find("a.go-back").trigger("tap")
						}),
						f.find("div.action a.button").on("tap",
						function(s) {
							s.preventDefault();
							var o = e(this);
							if (!o.hasClass("button-disabled")) {
								(o.addClass("button-disabled"), t.request(function() {
									o.removeClass("button-disabled")
								}))
							}
						})
					},
					attach: function() {
						var e = this;
						r.attach("pageSwitch",
						function(t, i, s, o) {
							b = "page-buy" === t,
							b && (e.initData(), x.isBuy = i, e.updateView(i, o))
						}),
						r.attach("newQuoteData",
						function(t, i) {
							_ = t,
							b && e.elems && (e.updateCurrPrice(), null != x.isBuy && e.updateTradeDir(x.isBuy, i))
						})
					},
					request: function(e) {
						i.post({
							url: C,
							data: x,
							success: function(e) {
								u.done(e,
								function() {
									x.identity = a.get(16),
									e.success && (m.hide(), p.show(), x.isBuy = null, r.notify("switchToPanel", "open-interest"))
								})
							},
							complete: function() {
								e()
							}
						})
					},
					updateView: function(e, t) {
						var i = this.elems;
						i.trade.text(h.commName + " - " + h.contCode.toUpperCase() + " 期权"),
						this.updateRate(),
						this.updateMinute(),
						this.updateMoney(),
						this.updateCurrPrice()
					},
					
					updateRate: function() {
						var t = h.rateList[h.minuteCur],
						t = Math.abs(t),
						i = '&nbsp;&nbsp;&nbsp;' + t + "%",
						iv = '&nbsp;&nbsp;&nbsp;' + parseInt(h.moneyList[h.moneyCur]+h.moneyList[h.moneyCur]*t/100) + "元";
						this.elems.ratel.html(i),
						this.elems.rater.html(iv)
					},
					updateCurrPrice: function() {
						var e = _[h.contCode],
						t = x.isBuy ? e.wt_sale_price: e.wt_buy_price,
						t = "--" !== t ? t: x.isBuy ? e.wt_buy_price: e.wt_sale_price,
						t = e.price,
						t = "最新执行价" + t.toFixed(h.scale);
						this.elems.instant_buy.text("即时执行（" + t + "）")
					},
					updateMinute: function() {
						var e = "",
						t = "";
						e = '<span class="lot ${selected}" data-value="${lot}" data-index="${index}">${lot}秒</span>',
						h.minuteCur < h.minuteShow ? (h.minuteList.forEach(function(i, s) {
							s < h.minuteShow && (t += o.format(e, {
								lot: i,
								index: s,
								selected: s === h.minuteCur ? "selected": ""
							}), s === h.minuteCur && (x.minute = i))
						}), h.minuteList.length > h.minuteShow && (t += '<span class="more more-lot iconfont">&#xe603;</span>')) : (t += o.format(e, {
							lot: h.minuteList[h.minuteCur],
							index: h.minuteCur,
							selected: "selected"
						}), x.minute = h.minuteList[h.minuteCur], t += '<span class="more more-lot iconfont">&#xe603;</span>'),
						this.elems.minute.html(t)
					},
					updateMoney: function() {
						var e = "",
						t = "";
						e = '<span class="lot ${selected}" data-value="${lot}" data-index="${index}">${lot}元</span>',
						h.moneyCur < h.moneyShow ? (h.moneyList.forEach(function(i, s) {
							s < h.moneyShow && (t += o.format(e, {
								lot: i,
								index: s,
								selected: s === h.moneyCur ? "selected": ""
							}), s === h.moneyCur && (x.money = i))
						}), h.moneyList.length > h.moneyShow && (t += '<span class="more more-lot iconfont">&#xe603;</span>')) : (t += o.format(e, {
							lot: h.moneyList[h.moneyCur],
							index: h.moneyCur,
							selected: "selected"
						}), x.money = h.moneyList[h.moneyCur], t += '<span class="more more-lot iconfont">&#xe603;</span>'),
						this.elems.money.html(t),
						this.elems.rater.html('&nbsp;&nbsp;&nbsp;' + parseInt(h.moneyList[h.moneyCur]+h.moneyList[h.moneyCur]*h.rateList[h.minuteCur]/100) + "元")
					},
					updateTradeDir: function(e, t) {
						var i = this.elems,
						s = e ? "确定看涨": "确定看跌",
						o = e ? "button-buy-highs text-s18": "button-buy-lows text-s18";
						if (t) {
							var n = _[h.contCode];
							if (n) {
								var a = n.limit_rate_1.replace("%", "") - 0;
								e ? a < n.commBuyLimit && (s = "当前跌幅超过 " + n.commBuyLimit + "% 暂停买涨", o = "button-disabled text-s16") : a > n.commSellLimit && (s = "当前涨幅超过 " + n.commSellLimit + "% 暂停买跌", o = "button-disabled text-s16")
							}
						}
						i.trade_dir.text(s),
						i.trade_dir[0].className = "button " + o
					},
					c2list: function(e, t, i) {
						var s = [];
						return e.forEach(function(e, o) {
							s.push({
								name: e * t + i,
								value: e * t,
								index: o
							})
						}),
						s
					}
				}
			});
		},
		"assets/js/lang/mod-loader": function() {
			define(function(require, n, i) {
				"use strict";
				var t = require("$"),
				c = require("_"),
				r = t("#doc"),
				f = function(n) {
					return r.find(n).length
				},
				o = function(n) {
					c.each(n,
					function(n) {
						c.isString(n) ? require.async(n,
						function(n) {
							n && n.init && n.init()
						}) : n && n.init && n.init()
					})
				};
				i.exports = function(n) {
					c.isString(n) && (n = [n]),
					c.isArray(n) ? o(n) : c.each(n,
					function(n, i) {
						f(i) && o(c.isArray(n) ? n: [n])
					})
				}
			});
		},
		"assets/js/biz/page/trade/hash": function() {
			define(function(require) {
				"use strict";
				var t = require("_"),
				n = (require("log"), require("dataStore")),
				i = require("mod/observer"),
				a = n.get("config"),
				e = a.BASE,
				o = a.QTCONFIG,
				r = !1;
				return {
					init: function() {
						this.parse(),
						this.wait(),
						this.attach()
					},
					wait: function() {
						var t = this,
						n = function(n) {
							n.state ? r && (window.location.href = n.state.jumpUrl) : t.notify()
						};
						window.addEventListener("popstate", n, !1)
					},
					attach: function() {
						var t = this;
						i.attach("changePageHash",
						function(n) {
							r = !0;
							var i = {
								jumpUrl: document.referrer
							},
							a = "#!" + n;
							window.history.replaceState(i, document.title, a),
							t.notify()
						}),
						i.attach("authFail",
						function(t) { ("no_login" === t || "no_signed" === t || "jump" === t) && (r = !1)
						})
					},
					notify: function() {
						this.parse(),
						i.notify("pageHashChanged")
					},
					parse: function() {
						var n = window.location.hash,
						i = n ? n.substring(2) : a.tradeComm;
						t.extend(a.base, e[i]),
						t.extend(a.qtConfig, o[i])
					}
				}
			});
		},
		"assets/js/util/dom": function() {
			define(function(require) {
				"use strict";
				var e = require("$"),
				t = require("_"),
				n = {
					create: function(e) {
						return document.createElementNS("http://www.w3.org/2000/svg", e)
					},
					createText: function(e) {
						return document.createTextNode(e)
					},
					append: function(e, t) {
						return e.appendChild(t),
						t
					},
					insert: function(e, t, n) {
						return e.insertBefore(t, n),
						t
					},
					remove: function(e) {
						e.parentNode.removeChild(e)
					},
					query: function(e) {
						return document.querySelector(e)
					},
					childs: function(e) {
						if (e.children) return e.children;
						for (var t = e.childNodes,
						n = [], r = 0; r < t.length; r++) 1 === t[r].nodeType && n.push(t[r]);
						return n
					},
					attr: function(e, r, i) {
						if (t.isString(r) && null == i) return e.getAttribute(r);
						if (t.isString(r)) {
							if ("style" === r && t.isObject(i)) {
								var u = "";
								t.each(i,
								function(e, t) {
									u += t + ":" + e + ";"
								}),
								i = u
							}
							e.setAttribute(r, i)
						} else t.each(r,
						function(t, r) {
							n.attr(e, r, t)
						})
					},
					textContent: function(e, t) {
						if (null == t) return e.firstChild.nodeValue;
						var r = n.create("tspan");
						n.append(r, n.createText(t)),
						n.append(e, r)
					},
					getSize: function(t) {
						var n = e(t);
						return {
							width: n.width(),
							height: n.height()
						}
					}
				};
				return n
			});
		},
		"data/holidays/1.0/main": function() {
			define(function(require) {
				"use strict";
				var e = require("_"),
				t = {
					2015 : {
						10 : [1, 2, 3, 4, 5, 6, 7]
					},
					2016 : {}
				};
				return {
					isHoliday: function(n) {
						n = n || new Date,
						n = n instanceof Date ? n: new Date(n);
						var a = t[n.getFullYear()];
						if (!a) return ! 1;
						var r = a[n.getMonth() + 1];
						return r ? e.contains(r, n.getDate()) : !1
					},
					isWeekend: function(e) {
						e = e || new Date,
						e = e instanceof Date ? e: new Date(e);
						var t = e.getDay();
						return 0 === t || 6 === t
					}
				}
			});
		},
		"data/contract/1.0/main": function() {
			define(function(require) {
				"use strict";
				var e = require("_"),
				r = require("util/dates"),
				t = require("data/holidays"),
				i = [["17:00", "23:45"],["09:15", "12:00"], ["13:00", "16:15"]],
				ii = [["09:15", "12:00"], ["13:00", "16:15"],["17:00", "23:45"]],
				m = [["06:00", "24:00"],["00:00", "05:00"]],
				mm = [["15:00", "24:00"],["00:00", "04:00"]],
				l = {
					ES: m,
					CL: m,
					GC: m,
					EC: mm,
					HSI: ii
				},
				g = {
					ES: m,
					CL: m,
					GC: m,
					EC: mm,
					HSI: i
				};
				return {
					getCommCode: function(e) {
						return e && e.replace(/\d+/g, "").toUpperCase()
					},
					getQueryPeriod: function(e) {
						return g[e]
					},
					getRealOpenTime: function(r) {
						var t = g[this.getCommCode(r)],
						i = t[0][0];
						return e.isArray(i) ? i[0] : i
					},
					getTitlePeriod: function(r, t) {
						var i = g[r];
						if (e.isArray(i[0][0])) {
							var a = i[1],
							n = i[0],
							o = a[0][0].replace(":", "") - 0,
							s = n[0][0].replace(":", "") - 0;
							i = t >= o && s > t ? a: n
						}
						return i
					},
					isInPeriod: function(e) {
						var i = new Date,
						a = i.getDay(),
						n = !1;
						if (0 === a) return n;
						var o = this.getCommCode(e),
						s = this.getQueryPeriod(o),
						u = r.format(i, "h:m");
						return s.forEach(function(e) {
							var r = e[0],
							i = e[1];
							6 === a ? "00:00" === r && u >= r && i > u && (n = !0) : 1 === a ? "00:00" !== r && u >= r && i > u && (n = !t.isHoliday()) : u >= r && i > u && (n = !t.isHoliday())
						}),
						n
					},
					getTipsForNextTime: function(e) {
						var i = l[e],
						a = new Date,
						n = r.format(a, "h:m");
						i[0][0] instanceof Array && (i = i[1].slice().concat(i[0]));
						for (var o, s, u = i.length,
						f = 0; u > f; f++) if (o = i[f], "00:00" !== o[0] && o[0] > n) {
							s = o[0];
							break
						}
						var c = i[0][0],
						d = i[u - 1][1],
						m = "今天 ",
						g = function() {
							for (var e = 0; e++, a.setDate(a.getDate() + 1), t.isWeekend(a) || t.isHoliday(a););
							s = c,
							m = 1 >= e ? "明天 ": r.format(a, "M月D日 ", !0)
						};
						return t.isWeekend(a) || t.isHoliday(a) ? g() : d > c && n > d && g(),
						"已休市，下次交易时间<em>" + m + (s || c) + "</em>"
					}
				}
			});
		},
		"assets/js/util/numbers": function() {
			define(function() {
				"use strict";
				var r = {
					u: function(n, u) {
						u || (u = 0),
						r.isS(n) && (n = r.f(n));
						var o;
						return n > 0 ? 1e5 > n ? r.round(n) : (1e8 > n ? (n /= 1e4, o = "万") : (n /= 1e8, o = "亿"), 0 == u ? r.round(n, 2).toFixed(2) + o: 1 == u ? n >= 100 ? r.round(n) + o: r.round(n, 2).toFixed(2) + o: 2 == u ? n >= 100 ? r.round(n) + o: r.round(n, 1).toFixed(1) + o: r.round(n) + o) : 0 > n ? n > -1e5 ? r.round(n) : (n > -1e8 ? (n /= 1e4, o = "万") : (n /= 1e8, o = "亿"), 0 == u ? r.round(n, 2).toFixed(2) + o: 1 == u ? -100 >= n ? r.round(n) + o: r.round(n, 2).toFixed(2) + o: 2 == u ? -100 >= n ? r.round(n) + o: r.round(n, 1).toFixed(1) + o: r.round(n) + o) : "0"
					},
					round: function(r, n) {
						if (n || (n = 0), 0 >= n) return Math.round(r);
						for (var u = 1,
						o = 0; n > o; o++) u *= 10;
						return Math.round(r * u) / u
					},
					isS: function(r) {
						return "string" == typeof r
					}
				};
				return {
					format: function(r) {
						if ("number" != typeof r) return r + "";
						for (var n = 0 > r ? "-": "", u = Math.abs(r) + "", o = u.length, t = "", e = 0; o-->0;) e++,
						t = u.charAt(o) + t,
						e % 3 === 0 && 0 !== o && (e = 0, t = "," + t);
						return n + t
					},
					money: function(r) {
						var n = 0 | r,
						r = r + "",
						u = r.indexOf(".");
						return this.format(n) + ( - 1 === u ? "": r.substring(u))
					},
					shrink: function(n) {
						return "number" == typeof n ? r.u(n) : n
					},
					fill: function(r) {
						return (10 > r ? "0": "") + r
					}
				}
			});
		},
		"assets/js/ui/chart/sline/1.0/main": function() {
			define(function(require) {
				"use strict";
				var t = require("_"),
				i = (require("log"), require("util/dom")),
				e = require("util/dates"),
				h = require("util/numbers"),
				s = "red",
				n = "#e8e8e8",
				r = "#f8f8f8",
				a = "#2f84cc",
				l = "#ff7700",
				c = "#888",
				o = "#d0402d",
				u = "#17b03e",
				m = 5e-4,
				d = .005,
				g = 2e-4,
				p = .002,
				v = m,
				_ = d,
				x = 7,
				b = function(t) {
					this.svg = t.svg,
					this.data = t.data || {},
					this.quoteTime = null,
					this.period = null,
					this.close = 0,
					this.open = 0,
					this.limitUp = 0,
					this.limitDown = 0,
					this.scale = 2,
					this.code = "",
					this.moments = null,
					this.init()
				};
				return b.prototype = {
					init: function() {
						this.resize(),
						this.gPricesEl = i.childs(this.svg)[1],
						this.gVolumesEl = i.childs(this.svg)[2],
						this.gHeartbeat = i.childs(this.svg)[3],
						this.cacheEl = [],
						this.pathEl = null,
						this.pathBgEl = null,
						this.pathAvEl = null,
						this.maxPrice = 0,
						this.minPrice = 0,
						this.maxVolume = 0,
						this.minVolume = 0,
						this.beginPrice = 0,
						this.endPrice = 0,
						this._path()
					},
					resize: function() {
						this.svgWidth = i.getSize(this.svg).width,
						this.svgHeight = i.getSize(this.svg).height;
						var t = 20;
						this.priceChartBox = {
							x: {
								begin: 0,
								end: this.svgWidth,
								width: this.svgWidth
							},
							y: {
								begin: 0,
								end: .75 * this.svgHeight,
								height: .75 * this.svgHeight
							}
						},
						this.volumeChartBox = {
							x: {
								begin: 0,
								end: this.svgWidth,
								width: this.svgWidth
							},
							y: {
								begin: this.priceChartBox.y.end + t,
								end: this.svgHeight,
								height: this.svgHeight - this.priceChartBox.y.height - t
							}
						}
					},
					setHeartbeat: function(t, e, h) {
						this.heartbeatEl_1 || (this.heartbeatEl_1 = i.childs(this.gHeartbeat)[0], this.heartbeatEl_2 = i.childs(this.gHeartbeat)[1]),
						2 !== arguments.length ? t ? (i.attr(this.gHeartbeat, "class", ""), i.attr(this.heartbeatEl_1, "class", "heartbeat"), i.attr(this.heartbeatEl_2, "class", "heartbeat")) : (i.attr(this.gHeartbeat, "class", "hide"), i.attr(this.heartbeatEl_1, "class", ""), i.attr(this.heartbeatEl_2, "class", "")) : (h = e, e = t),
						null != e && null != h && (i.attr(this.heartbeatEl_1, {
							cx: e,
							cy: h
						}), i.attr(this.heartbeatEl_2, {
							cx: e,
							cy: h
						}))
					},
					draw: function(t) {
						var i = function() {
							t && this._setConfig(t),
							t && t.data && (this.data = t.data, this._setMaxMin()),
							this._last_code = null,
							this._last_time = null,
							this._last_volume = null
						};
						this._draw(i)
					},
					perDraw: function(t, i) {
						var e = function() {
							i && this._setConfig(i),
							this.data[t.time] = t,
							this.maxPrice = Math.max(this.maxPrice, t.current),
							this.minPrice = Math.min(this.minPrice > 0 ? this.minPrice: t.current, t.current),
							this.maxVolume = Math.max(this.maxVolume, t.volume),
							this.minVolume = Math.min(this.minVolume > 0 ? this.minVolume: t.volume, t.volume)
						};
						this._limit(t,
						function() {
							this._draw(e)
						})
					},
					_draw: function(i) {
						i.call(this),
						this._clear(),
						this._drawFramework(),
						t.keys(this.data).length ? this._drawChart() : this._drawBasePriceLine()
					},
					_clear: function() {
						t.each(this.cacheEl,
						function(t) {
							t && i.remove(t)
						}),
						this.cacheEl.length = 0
					},
					_drawFramework: function() {
						var t = this.cacheEl,
						i = this.pathBgEl,
						e = this.gPricesEl,
						h = this.gVolumesEl,
						s = this.priceChartBox.x,
						r = this.priceChartBox.y,
						a = this.volumeChartBox.x,
						l = this.volumeChartBox.y;
						t.push(this._line(e, s.begin, r.end, s.end, r.end, n, "", i)),
						t.push(this._line(h, a.begin, l.begin, a.end, l.begin, n)),
						t.push(this._line(h, a.begin, l.begin + l.height / 2, a.end, l.begin + l.height / 2)),
						t.push(this._line(h, a.begin, l.end - .5, a.end, l.end - .5))
					},
					_drawBasePriceLine: function() {
						var t = this.cacheEl,
						i = this.gPricesEl,
						e = this.priceChartBox.x,
						h = this.priceChartBox.y;
						t.push(this._line(i, e.begin, h.begin, e.end, h.begin)),
						t.push(this._line(i, e.begin, h.begin + .2 * h.height, e.end, h.begin + .2 * h.height)),
						t.push(this._line(i, e.begin, h.begin + .8 * h.height, e.end, h.begin + .8 * h.height))
					},
					_drawChart: function() {
						this._drawPeriodLine(),
						this._drawPriceLine(),
						this._drawPath(),
						this._drawBar()
					},
					_drawPeriodLine: function() {
						var i = this,
						e = this.cacheEl,
						h = this.pathAvEl,
						s = this.gPricesEl,
						n = this.priceChartBox.x,
						r = this.priceChartBox.y,
						a = this.moments,
						l = a.length,
						c = this.period.length,
						o = n.width - 1,
						u = o / (l - 1),
						m = {};
						t.each(this.period,
						function(i, e) {
							m[i[0]] = t.indexOf(a, i[0].replace(":", "") - 0),
							e === c - 1 && (m[i[1]] = l - 1)
						});
						var d, g;
						t.each(m,
						function(t, a) {
							d = (t * u).toFixed(4) - 0,
							d = t === l - 1 ? n.end - .5 : d + .5,
							e.push(i._line(s, n.begin + d, r.begin, n.begin + d, r.end, "", "", h)),
							d = t > 1 && l - 1 > t ? d - 15 : d,
							g = t === l - 1 ? "end": "",
							e.push(i._text(s, n.begin + d, r.end + 14, a, "", g, h))
						})
					},
					_drawPriceLine: function() {
						var t = this.maxPrice,
						i = this.minPrice,
						e = this.close,
						n = this.open,
						r = this.limitUp,
						a = this.limitDown;
						t += n * v,
						i -= n * v;
						var l = (t - i) / n;
						_ > l && (l = (_ - l) / 2, t += n * l, i -= n * l),
						t = t > r && r > 0 ? r: t,
						i = a > i ? a: i,
						this.beginPrice = t,
						this.endPrice = i;
						for (var c = this.cacheEl,
						m = this.pathAvEl,
						d = this.gPricesEl,
						g = this.priceChartBox.x,
						p = this.priceChartBox.y,
						b = p.height / x,
						f = 0; x > f; f++) {
							var P = g.begin,
							E = p.begin + f * b + (0 === f ? .5 : 0),
							w = g.end,
							B = E;
							c.push(this._line(d, P, E, w, B, "", "", m))
						}
						var C, y, V, M = this.beginPrice - this.endPrice,
						T = this.beginPrice - e,
						P = g.begin,
						E = p.begin + p.height * (T / M),
						E = 0 > E ? -1e3: E > p.height ? 1e3: E;
						w = g.end,
						B = E,
						c.push(this._line(d, P, E, w, B, s, "3,3", m)),
						e <= this.minPrice ? (y = E + 14, y = y >= p.height - b ? E - 4 : y) : e >= this.maxPrice ? (y = E - 4, y = b >= y ? E + 14 : y) : y = E + (E < p.height / 2 ? 14 : -4),
						C = g.begin + 3,
						V = e.toFixed(this.scale),
						c.push(this._text(d, C, y, V, "", "", m)),
						C = g.end - 3,
						V = "0.00%",
						c.push(this._text(d, C, y, V, "", "end", m)),
						(0 > E || E >= p.begin + b / 2) && (C = g.begin + 3, y = p.begin + 14, V = this.beginPrice.toFixed(this.scale), c.push(this._text(d, C, y, V, 0 > T ? u: o, "", m)), C = g.end - 3, y = p.begin + 14, V = T / e * 100, V = (V >= 0 ? "+": "") + V.toFixed(2) + "%", c.push(this._text(d, C, y, V, 0 > T ? u: o, "end", m))),
						(E > p.height || E <= p.height - b / 2) && (T = this.endPrice - e, C = g.begin + 3, y = p.end - 5, V = this.endPrice.toFixed(this.scale), c.push(this._text(d, C, y, V, 0 > T ? u: o, "", m)), C = g.end - 3, y = p.end - 5, V = T / e * 100, V = (V >= 0 ? "+": "") + V.toFixed(2) + "%", c.push(this._text(d, C, y, V, 0 > T ? u: o, "end", m))),
						d = this.gVolumesEl,
						g = this.volumeChartBox.x,
						p = this.volumeChartBox.y,
						C = g.end - 3,
						y = p.begin + (p.height / 2 - 10),
						V = h.shrink(this.maxVolume),
						c.push(this._text(d, C, y, V, "", "end"))
					},
					_drawPath: function() {
						var i, h = this,
						s = this.priceChartBox.x,
						n = this.priceChartBox.y,
						r = this.beginPrice,
						a = this.endPrice,
						l = this.data,
						c = this.moments,
						o = s.width - 1,
						u = n.height,
						m = o / (c.length - 1),
						d = function(t) {
							var i = .5 + t * m + m;
							return (s.begin + i).toFixed(4) - 0
						},
						g = function(t) {
							var i = (r - t) / (r - a) * u,
							i = 0 === i ? .5 : i;
							return (n.begin + i).toFixed(4) - 0
						},
						p = function(t) {
							return "M0," + g(t)
						},
						v = function(t) {
							return "L" + d(t) + "," + (n.end - .5) + "L" + s.begin + "," + (n.end - .5) + "Z"
						},
						_ = 0,
						x = 0,
						b = 0,
						f = e.prevMinute(c[0]).replace(":", "") - 0,
						P = p(l[f].current),
						E = l[f].average,
						w = E > .01,
						B = w ? p(E >= a ? E: a) : "M0,0";
						t.each(c,
						function(t, e) {
							if (!h._isTradeTime(t)) return ! 1;
							var s = l[t];
							if (null == s && (s = i, null == s)) {
								var n = h.open,
								n = n > h.beginPrice ? h.beginPrice: n,
								n = n < h.endPrice ? h.endPrice: n;
								s = {
									current: n,
									average: n,
									volume: 0,
									time: t
								}
							}
							x = d(e),
							b = g(s.current),
							P += "L" + x + "," + b,
							w && (E = s.average >= a ? s.average: a, B += "L" + x + "," + g(E)),
							_ = e,
							i = s
						});
						var C = P + v(_);
						this._path(P, C, B),
						this.setHeartbeat(x, b)
					},
					_drawBar: function() {
						var i, e, h, s, n, r, a = this,
						l = this.cacheEl,
						c = this.gVolumesEl,
						m = this.volumeChartBox.x,
						d = this.volumeChartBox.y,
						g = this.maxVolume,
						p = m.width - 1,
						v = d.height - .5 - 1,
						_ = p / (this.moments.length - 1),
						x = function(t) {
							var i = .5 + t * _ + _;
							return (m.begin + i).toFixed(4) - 0
						},
						b = function(t) {
							var i = (1 - t / g * .9) * v;
							return (d.begin + .5 + i).toFixed(4) - 0
						},
						f = this.data;
						t.each(this.moments,
						function(t, m) {
							if (!a._isTradeTime(t)) return ! 1;
							var g = f[t];
							if (null != g) {
								var p = i ? i.volume: 0;
								e = x(m),
								h = b(g.volume),
								s = e,
								n = d.end - 1,
								r = g.volume >= p ? o: u,
								null == i && (r = g.current >= a.close ? o: u),
								l.push(a._line(c, e, h, s, n, r)),
								i = g
							}
						})
					},
					_path: function(t, e, h) {
						this.pathEl || (this.pathEl = i.create("path"), this.pathBgEl = i.create("path"), this.pathAvEl = i.create("path"), i.attr(this.pathEl, {
							stroke: a,
							fill: "none"
						}), i.attr(this.pathBgEl, {
							stroke: "none",
							fill: a,
							"fill-opacity": "0.2"
						}), i.attr(this.pathAvEl, {
							stroke: l,
							fill: "none"
						}), i.append(this.gPricesEl, this.pathAvEl), i.append(this.gPricesEl, this.pathBgEl), i.append(this.gPricesEl, this.pathEl)),
						t && i.attr(this.pathEl, "d", t),
						e && i.attr(this.pathBgEl, "d", e),
						h && i.attr(this.pathAvEl, "d", h)
					},
					_line: function(t, e, h, s, n, a, l, c) {
						var o = i.create("line");
						return i.attr(o, {
							x1: e,
							y1: h,
							x2: s,
							y2: n,
							stroke: a || r
						}),
						l && i.attr(o, "stroke-dasharray", l),
						c ? i.insert(t, o, c) : i.append(t, o),
						o
					},
					_text: function(t, e, h, s, n, r, a) {
						var l = i.create("text");
						return i.attr(l, {
							x: e,
							y: h,
							fill: n || c,
							style: {
								"text-anchor": r || "start"
							}
						}),
						i.textContent(l, s),
						a ? i.insert(t, l, a) : i.append(t, l),
						l
					},
					_limit: function(t, i) {
						this._last_code === this.code && this._last_time === t.time ? this._last_volume !== t.volume && i.call(this) : i.call(this),
						this._last_code = this.code,
						this._last_time = t.time,
						this._last_volume = t.volume
					},
					_setConfig: function(t) {
						t.quoteTime && (this.quoteTime = t.quoteTime),
						null != t.close && (this.close = t.close),
						null != t.open && (this.open = t.open),
						t.period && (this.period = t.period, this.moments = this._period2moments()),
						t.code && (this.code = t.code, this._setLimitPrice()),
						t.limitUp && (this.limitUp = t.limitUp, this.limitDown = t.limitDown),
						null != t.scale && (this.scale = t.scale, v = this.scale <= 2 ? m: g, _ = this.scale <= 2 ? d: p)
					},
					_setMaxMin: function() {
						var i = this,
						h = this.data,
						s = this.moments;
						if (this.maxPrice = 0, this.minPrice = 0, this.maxVolume = 0, this.minVolume = 0, this.beginPrice = 0, this.endPrice = 0, t.keys(h).length) {
							var n = -1,
							r = e.prevMinute(s[0]).replace(":", "") - 0,
							a = h[r].current;
							this.maxPrice = a,
							this.minPrice = a,
							t.each(s,
							function(t, e) {
								if (i._isTradeTime(t)) {
									var s = h[t];
									if (null == s) return void n++;
									e === n && (s.volume = 0),
									i.maxPrice = Math.max(i.maxPrice, s.current),
									i.minPrice = Math.min(i.minPrice > 0 ? i.minPrice: s.current, s.current),
									i.maxVolume = Math.max(i.maxVolume, s.volume),
									i.minVolume = Math.min(i.minVolume > 0 ? i.minVolume: s.volume, s.volume)
								}
							})
						}
					},
					_setLimitPrice: function() {
						var t = .1;
						/^S|^ST|.*ST/.test(this.code) && (t = .05),
						this.limitUp = this.close * (1 + t),
						this.limitDown = this.close * (1 - t)
					},
					_period2moments: function() {
						var i = [];
						t.each(this.period,
						function(t) {
							for (var e = t[0], s = t[1], n = e.split(":"), r = n[0] - 0, a = n[1] - 0, l = s.split(":"), c = l[0] - 0, o = l[1] - 0; c >= r && (60 === a && (r += 1, a = 0), !(r === c && a > o - 1)); a++) i.push(r + h.fill(a) - 0)
						});
						var e = this.period[this.period.length - 1][1],
						e = e.replace(":", "") - 0;
						return i.push(e),
						this.quoteTime === e && i.push(e + 1),
						i
					},
					_isTradeTime: function(t) {
						var i = this.moments,
						e = i[0],
						h = i[i.length - 1],
						s = this.quoteTime;
						if (e > h) {
							if (s >= e && 2400 > s) return t >= e && s >= t;
							if (t >= e && 2400 > t) return ! 0
						}
						return s >= t
					}
				},
				b
			});
		},
		"assets/js/biz/page/trade/sline": function() {
			define(function(require) {
				"use strict";
				var e = require("$"),
				t = require("_"),
				i = require("log"),
				a = require("net"),
				n = require("dataStore"),
				o = require("util/dates"),
				r = require("util/timer"),
				c = require("util/dom"),
				l = require("data/contract"),
				u = require("mod/observer"),
				s = require("ui/sline"),
				h = require("ui/loading"),
				m = n.get("config"),
				f = m.base,
				d = m.qtConfig,
				p = n.get("urlSline"),
				v = f.contCode,
				g = {},
				w = {},
				D = -1,
				_ = 0,
				C = !0,
				S = !0,
				q = !0,
				y = !1;
				return {
					init: function() {
						v = f.contCode,
						this.wait(),
						this.attach(),
						this.initChart()
					},
					wait: function() {
						var t, i = this;
						e(window).on("resize",
						function() {
							t && t.clear(),
							t = r.one(function() {
								S && q && C && i.resize()
							},
							100)
						})
					},
					attach: function() {
						var e = this;
						u.attach("newQuoteData",
						function(t) {
							g = t,
							C && y && e.newQuoteData()
						}),
						u.attach("newQuoteBegin",
						function() {
							e.sline.setHeartbeat(!0)
						}),
						u.attach("newQuoteEnd",
						function() {
							e.sline.setHeartbeat(!1)
						}),
						u.attach("changeContract",
						function(t) {
							y = !1,
							v = t,
							w = {},
							D = -1,
							_ = 0,
							C && e.querySlineData(t)
						}),
						u.attach("reloadData",
						function() {
							y = !1,
							w = {},
							D = -1,
							_ = 0,
							C && e.querySlineData(v)
						}),
						u.attach("chartSwitch",
						function(t) {
							y = !1,
							C = "tick" === t,
							w = {},
							C && e.querySlineData(v)
						}),
						u.attach("pageSwitch",
						function(e) {
							S = "page-quote" === e
						}),
						u.attach("panelSwitch",
						function(e) {
							q = "make" === e
						})
					},
					initChart: function() {
						this.sline = new s({
							svg: e("#tick-sline")[0]
						}),
						this.resize(),
						this.querySlineData(v)
					},
					querySlineData: function(e) {
						var t = this,
						n = this.showLoading();
						a.jsonp({
							url: p,
							data: {
								code: e
							},
							success: function(a) {
								t.hideLoading(n),
								a.success ? t.processData(a.data, e) : i.error("查询分时图数据失败")
							},
							error: function(e, a) {
								t.hideLoading(n),
								i.error("分时接口异常", a)
							}
						})
					},
					processData: function(e, t) {
						if (v === t) {
							var i = this,
							a = {},
							n = null,
							c = null,
							u = null,
							s = function() {
								u = o.format(n.time, "hm") - 0,
								c = l.getTitlePeriod(l.getCommCode(t), u);
								var i = l.getRealOpenTime(t).replace(":", "") - 0,
								r = c[0][0].replace(":", "") - 0,
								s = o.prevMinute(r).replace(":", "") - 0,
								h = 1800 > i;
								if (e) {
									var m = e.split(";"),
									f = m.length;
									if (u !== i) {
										var d = m[f - 1].split(",");
										for (D = d[3] - 0, _ = d[4] - 0; f-->0;) {
											var p = m[f].split(","),
											v = p[3] - 0;
											if (a[v] = {
												current: p[0] - 0,
												average: p[1] - 0,
												volume: p[2] - 0,
												time: v
											},
											v === r) {
												var g = m[f - 1];
												if (g) {
													var p = g.split(",");
													a[s] = {
														current: p[0] - 0,
														average: (h && p[1]) - 0,
														volume: 0,
														time: s
													}
												}
											}
											if (v === i) break
										}
									}
									if (!a[s]) {
										var p = m[0].split(",");
										a[s] = {
											current: p[0] - 0,
											average: (h && p[1]) - 0,
											volume: 0,
											time: s
										}
									}
								} else a[s] = {
									current: .01,
									average: 0,
									volume: 0,
									time: s
								}
							},
							h = function() {
								a[u] = {
									current: n.price,
									average: n.average,
									volume: n.volume - _,
									time: u
								},
								i.sline.draw({
									data: a,
									quoteTime: u,
									open: n.open,
									close: n.settle_price_yes,
									limitUp: n.limit_up_price,
									limitDown: n.limit_down_price,
									period: c,
									scale: f.scale,
									code: t
								}),
								delete a[u],
								w[t] = a,
								y = !0
							},
							m = function() {
								v === t && (n = g[t], n ? (s(), h()) : r.one(m, 300))
							};
							m()
						}
					},
					newQuoteData: function() {
						var e = w[v],
						i = g[v];
						if (.01 !== i.price) {
							var a = {
								current: i.price,
								average: i.average,
								volume: 0,
								time: o.format(i.time, "hm") - 0
							};
							if (null == e[a.time]) {
								for (var n, r, c = 0,
								u = t.keys(e).length; u > 0 && (c += 6e4, r = o.format(i.time - c, "hm") - 0, r !== D) && !(n = e[r]); u--);
								n && (_ += n.volume)
							}
							a.volume = i.volume - _,
							this.sline.perDraw(a, {
								quoteTime: a.time,
								open: i.open,
								close: i.settle_price_yes,
								limitUp: i.limit_up_price,
								limitDown: i.limit_down_price,
								period: l.getTitlePeriod(l.getCommCode(v), a.time),
								scale: f.scale,
								code: v
							})
						}
					},
					resize: function() {
						var t = e(document).height(),
						i = e("#tick-sline"),
						a = i.offset(),
						n = d.state ? 102 : 60,
						o = t - a.top - n - 10;
						o > 300 && (i.height(o), c.attr(i[0], "height", o)),
						this.sline.resize(),
						this.sline.draw()
					},
					showLoading: function() {
						return r.one(function() {
							h.show()
						},
						1500)
					},
					hideLoading: function(e) {
						e.clear(),
						h.hide()
					}
				}
			});
		},
		"assets/js/biz/mod/position": function() {
			define(function(require) {
				"use strict";
				var e = (require("$"), require("_")),
				s = (require("log"), require("dataStore")),
				t = require("util/dates"),
				c = require("util/strings"),
				a = require("data/contract"),
				r = s.get("config"),
				i = r.BASE,
				o = '<ul class="mod-list mod-list-std" data-index="${index}"><li class="clearfix"><span class="left">${commodity} (${code})</span>${placeholder1}</li><li class="clearfix"><div class="left"><div class="title"><h3 class="${buy_dir_css}">${buy_dir_txt}<small class="text-lesser">${status}</small></h3><h3 class="income ${income_css}">盈亏${income_txt}</h3></div>${placeholder2}</div><div class="right"><div class="status ${block_css}"><span>${block_txt}</span></div></div></li><li class="action ${errmsg_css}"><span class="text-lesser">${tradeMsg}</span></li></ul>',
				l = c.format(o, {
					placeholder1: '<time class="right text-lesser">开仓${opentime}</time>',
					placeholder2: '<p class="text-lesser"><span>金额 ${money}元</span><span>${price1}</span></p><p class="text-lesser"><span>收益 ${rate}%</span><span>${price2}</span></p><p class="text-lesser"><span>时长 ${optime}秒</span><span>到期时间 ${closetime}</span></p>'
				}),
				n = c.format(o, {
					placeholder1: '<time class="right text-lesser">开仓${opentime}</time>',
					placeholder2: '<p class="text-lesser"><span>金额 ${money}元</span><span>${price1}</span></p><p class="text-lesser"><span>收益 ${rate}%</span><span>${price2}</span></p><p class="text-lesser"><span>剩余 <font color=green>${lasttime}秒</font></span><span class="ratetimewrap"><i class="ratetime" style="width:${ratetime}%;">&nbsp;</i><i class="ratetxt">${ratetime}%</i></span></p>'
				}),
				p = c.format(o, {
					placeholder1: '<time class="right text-lesser">开仓${opentime}</time>',
					placeholder2: '<p class="text-lesser"><span>金额 ${money}元</span><span>${price1}</span></p><p class="text-lesser"><span>收益 ${rate}%</span><span>${price2}</span></p><p class="text-lesser"><div>到期 ${closetime}</div></p>'
				});
				return {
					renderSettle: function(e, s, t) {
						return this._render(e, s, t, l)
					},
					renderOpenInterest: function(e, s, t) {
						return this._render(e, s, t, n)
					},
					renderSimple: function(e, s, t) {
						return this._render(e, s, t, p)
					},
					_render: function(s, r, o, l) {
						r = r || {},
						o = o || [];
						var n = this,
						p = "";
						return s.forEach(function(s, d) {
							var m = s.code,
							h = s.status,
							_ = i[a.getCommCode(m)].scale,unitPrice=i[a.getCommCode(m)].unitPrice,
							up = unitPrice,uu=up==6.4?'美元':(up==0.8?'港元':'元'),
							income = s.income*unitPrice,money = s.money*unitPrice,
							b = {
								index: d,
								commodity:i[a.getCommCode(m)].commName,
								money: s.money,
								rate: s.rate,
								optime:s.optime*60,
								ratetime:s.ratetime,
								closetime: s.closetime.toFixed ? t.format(s.closetime, "h:m:s") : s.closetime,
								opentime: s.opentime.toFixed ? t.format(s.opentime, "y-M-D h:m:s") : s.opentime,
								buy_dir_txt: s.isbuy==1 ? "看涨": "看跌",
								buy_dir_css: s.isbuy==1 ? "text-highs": "text-lows",
								income_txt: s.status==1?0:((s.income > 0 ? "+": "-") + (s.income==0?0:(s.income>0?s.income:s.money)).toFixed(2)+'元'),
								income_css: s.status==2&&s.income > 0 ? "text-highs": "text-lows",
								errmsg_css: s.tradeMsg ? "": "hide",
								status: ""
							};
							
							if (s.status == 1) {
								o.push(m);
								b.price1 = "执行价 " + s.pricebuy.toFixed(_),
								b.price2 = '当前价 <em data-code="' + m + '">' + s.pricelast.toFixed(_) + "</em>",
								b.block_css = "sold",
								b.block_txt = "进行中"
							} else if (s.status == 2) {
								b.price1 = "执行价 " + s.pricebuy.toFixed(_),
								b.price2 = "到期价 " + s.pricelast.toFixed(_),
								b.block_css = "normal",
								b.block_txt = "结算成功"
							}
							p += c.format(l, e.extend({},
							s, b))
						}),
						p
					}
				}
			});
		},
		"assets/js/biz/mod/auth": function() {
			define(function(require) {
				"use strict";
				var n = (require("log"), require("dataStore")),
				i = require("util/timer"),
				o = require("mod/observer"),
				e = n.get("config"),
				t = e.base,
				r = n.get("urlLogin"),
				g = n.get("urlSigned");
				return {
					login: function() {
						return e.isLogin === !1 && (o.notify("authFail", "no_login"), i.one(function() {
							window.location.href = r + '?' + t.commCode
						},
						100)),
						e.isLogin
					},
					isLogin: function() {
						return e.isLogin
					},
					signed: function() {
						return 1 === e.tradeType ? (t.signed === !1 && (o.notify("authFail", "no_signed"), i.one(function() {
							window.location.href = g + "?commodity=" + t.commCode
						},
						100)), t.signed) : !0
					}
				}
			});
		},
		"assets/js/biz/page/trade/open-interest": function() {
			define(function(require) {
				"use strict";
				var t = require("$"),
				e = require("_"),
				n = require("log"),
				a = require("net"),
				i = require("dataStore"),
				o = require("data/contract"),
				s = (require("util/dates"), require("util/timer")),
				c = require("util/numbers"),
				d = require("mod/ajax-result"),
				r = require("mod/observer"),
				l = require("mod/position"),
				u = require("mod/auth"),
				f = require("ui/msgbox"),
				h = t("#doc"),
				p = h.find("div.float"),
				v = h.find("div.page-trade"),
				m = h.find("div.page-buy-lows"),
				g = v.find("section.main-trade"),
				x = v.find("article.open-interest"),
				S = g.find("ul.mod-tab-sample"),
				w = x.children("div.lists"),
				D = '<div class="empty-tips">暂无交易</div>',
				b = i.get("config"),
				C = b.BASE,
				q = [],
				B = null,
				I = {
					schemeSort: 1,
					tradeType: b.tradeType,
					beginTime: ""
				},
				$ = i.get("urlScheme"),
				A = i.get("urlRevoke"),
				E = !0,
				P = !0,
				Q = !0;
				return {
					init: function() {
						this.initElems(),
						this.initData(),
						this.wait(),
						this.attach()
					},
					initElems: function() {
						var t = g.find("p.summary").find("em");
						this.$balance = t.eq(0),
						this.$incomeSum = t.eq(1)
					},
					initData: function() {
						var t = this;
						if (u.isLogin()) {
							var e = function() {
								B ? t.queryData() : s.one(e, 300)
							};
							e()
						}
					},
					wait: function() {
						
					},
					attach: function() {
						var t = this;
						r.attach("panelSwitch",
						function() {
							P && t.queryData()
						}),
						r.attach("pageSwitch",
						function() {
							E && P && t.queryData()
						}),
						r.attach("newQuoteData",
						function(e) {
							B = e,
							E && P && (t.newQuoteData(), t.calcIncome())
						}),
						r.attach("newQuoteBegin",
						function() {
							Q = !0
						}),
						r.attach("newQuoteEnd",
						function() {
							Q = !1
						})
					},
					queryData: function() {
						var t = this,
						e = 3e3,
						i = 0,
						o = function() {
							a.get({
								url: $,
								data: I,
								success: function(e) {
									d.done(e,
									function() {
										e.success ? (E && P && Q && r(), q = e.data, t.processData(e.data), t.updateBalance(e)) : n.error("获取持仓数据失败")
									})
								},
								error: function(t, e) {
									n.error("获取持仓数据失败", e)
								}
							})
						},
						c = function() {
							s.clear(i)
						},
						r = function() {
							c(),
							i = s.one(o, e).id
						};
						o(),
						this.queryData = function() {
							c(),
							o()
						}
					},
					processData: function(t) {
						if (null != B) {
							var n = [],
							a = l.renderOpenInterest(t, B, n);
							w.html(a ? a: D),
							r.notify("appendContractQuery", e.union(n)),
							this.showCount(t)
						}
					},
					showCount: function(t) {
						var e = S.find("span.icon-unread"),
						n = t.length;
						e.toggleClass("hide", 0 === n),
						n > 0 && e.text(100 > n ? n: "···")
					},
					newQuoteData: function() {
						w.find("em[data-code]").each(function() {
							var e = t(this),
							n = e.data("code"),
							a = B[n],
							i = C[o.getCommCode(n)].scale;
							e.text((a ? a.price: 0).toFixed(i))
						})
					},
					calcIncome: function() {
						var t = this,
						e = w.children("ul.mod-list-std"),
						n = 0;
						q.forEach(function(a, i) {
							var s = B[a.code] || {price: a.pricelast},
							c = s.price==a.pricebuy?0:(a.isbuy==1?(s.price>a.pricebuy?parseInt(a.money+a.money*a.rate/100):-a.money):(s.price<a.pricebuy?parseInt(a.money+a.money*a.rate/100):-a.money));
							n += c,t.updateIncome(r, e, i, c, '元')
						}),
						this.updateIncomeSum(n)
					},
					updateIncome: function(t, e, n, a, u) {
						var i = e.eq(n).find("h3.income");
						if (i[0]) {
							var o = a >= 0 ? "text-highs": "text-lows",
							s = '盈亏 '+(a > 0 ? "+": "") + a.toFixed(2)+u;
							i[0].className = "income " + o,
							i.text(s)
						}
					},
					updateIncomeSum: function(t) {
						if (this.$incomeSum[0]) {
							var e = t >= 0 ? "text-highs": "text-lows",
							n = (t > 0 ? "+": "") + t.toFixed(2)+'元';
							this.$incomeSum[0].className = e,
							this.$incomeSum.text(n)
						}
					},
					updateBalance: function(t) {
						this.$balance.text(c.money(t.balance))
					}
				}
			});
		},
		"assets/js/ui/chart/tick/1.0/main": function() {
			define(function(require) {
				"use strict";
				var t = require("_"),
				i = (require("log"), require("util/dom")),
				e = "#ccc",
				h = "#f8f8f8",
				s = "#2f84cc",
				a = "#888",
				n = "#fff",
				r = 5e-4,
				c = r,
				g = 2e-4,
				l = 1e-4,
				o = 20,
				d = 30,
				u = 120,
				_ = !0,
				f = function(t) {
					this.svg = t.svg,
					this.open = 0,
					this.price = 0,
					this.volume = 0,
					this.time = 0,
					this.scale = 0,
					this.code = "",
					this._setConfig(t),
					this.init()
				};
				return f.prototype = {
					init: function() {
						this.gRangeEl = i.childs(this.svg)[1],
						this.gTickEl = i.childs(this.svg)[2],
						this.gHeartbeat = i.childs(this.svg)[3],
						this.cacheEl = [],
						this.pathEl = null,
						this.ranges = [],
						this.prices = [],
						this.maxPrice = 0,
						this.minPrice = 0,
						this.initPrice = 0,
						this.isChanged = !1,
						this.resize(),
						this._drawFramework()
					},
					resize: function() {
						var t = i.getSize(this.svg),
						e = 10;
						this.svgWidth = t.width,
						this.svgHeight = t.height,
						this.chartBox = {
							x: {
								begin: 0,
								end: this.svgWidth,
								width: this.svgWidth
							},
							y: {
								begin: 0,
								end: this.svgHeight,
								height: this.svgHeight
							}
						},
						this.priceChartBox = {
							x: {
								begin: 0,
								end: this.svgWidth,
								width: this.svgWidth
							},
							y: {
								begin: e,
								end: this.svgHeight - e,
								height: this.svgHeight - 2 * e
							}
						},
						this.tickChartBox = {
							x: {
								begin: 0,
								end: this.svgWidth,
								width: this.svgWidth
							},
							y: {
								begin: e,
								end: this.svgHeight - e,
								height: this.svgHeight - 2 * e
							}
						}
					},
					clear: function() {
						r = c,
						this.ranges.length = 0,
						this.prices.length = 0,
						this.maxPrice = 0,
						this.minPrice = 0,
						this.initPrice = 0,
						this.isChanged = !1
					},
					setHeartbeat: function(t, e, h) {
						this.heartbeatEl_1 || (this.heartbeatEl_1 = i.childs(this.gHeartbeat)[0], this.heartbeatEl_2 = i.childs(this.gHeartbeat)[1]),
						2 !== arguments.length ? t ? (i.attr(this.gHeartbeat, "class", ""), i.attr(this.heartbeatEl_1, "class", "heartbeat"), i.attr(this.heartbeatEl_2, "class", "heartbeat")) : (i.attr(this.gHeartbeat, "class", "hide"), i.attr(this.heartbeatEl_1, "class", ""), i.attr(this.heartbeatEl_2, "class", "")) : (h = e, e = t),
						null != e && null != h && (i.attr(this.heartbeatEl_1, {
							cx: e,
							cy: h
						}), i.attr(this.heartbeatEl_2, {
							cx: e,
							cy: h
						}))
					},
					toggle: function() {
						return _ = !_
					},
					_drawFramework: function() {
						var t = this.chartBox.x,
						i = this.chartBox.y;
						this._line(this.svg, 0, i.begin + .5, t.end, i.begin + .5, h),
						this._line(this.svg, 0, i.end - .5, t.end, i.end - .5, h)
					},
					addPrice: function(t) {
						t && this._setConfig(t),
						this._hasTrading() && this._scrollPrices()
					},
					draw: function(t) {
						t && this._setConfig(t),
						this._hasTrading() && this._draw()
					},
					_draw: function() {
						this._drawBefore(),
						this._drawPriceRange(),
						this._drawTick()
					},
					_drawBefore: function() {
						this._clear(),
						this._scrollPrices(),
						this._setMaxMin(),
						this._calcRange(this.price)
					},
					_clear: function() {
						t.each(this.cacheEl,
						function(t) {
							t && i.remove(t)
						}),
						this.cacheEl.length = 0
					},
					_drawPriceRange: function() {
						var i = this,
						s = this.cacheEl,
						n = this.gRangeEl,
						r = this.priceChartBox.x,
						c = this.priceChartBox.y,
						g = this.ranges,
						l = this.scale,
						o = this.open,
						d = this._getTextSize(g[0].toFixed(l)),
						u = c.height / (g.length - 1);
						t.each(g,
						function(t, g) {
							var _ = t === o || t === i.initPrice,
							f = r.begin,
							x = c.begin + u * g,
							x = x.toFixed(4) - 0,
							p = r.end - d - 2,
							v = x,
							b = h;
							s.push(i._line(n, f, x, p, v, b)),
							p += 2,
							x += 4,
							b = _ ? a: e,
							t = t.toFixed(l),
							s.push(i._text(n, p, x, t, b))
						})
					},
					_drawTick: function() {
						var i = this.cacheEl,
						e = this.tickChartBox.x,
						h = this.tickChartBox.y,
						a = this.ranges,
						r = a[0],
						c = a[a.length - 1],
						g = r - c,
						l = h.height,
						o = e.width / u,
						d = "",
						_ = 0,
						f = 0,
						x = 0,
						p = 0;
						t.each(this.prices,
						function(t, i) {
							var e = 0 === i ? "M": "L";
							_ = o * i,
							_ = _.toFixed(4) - 0,
							f = h.begin + (r - t) / g * l,
							f = f.toFixed(4) - 0,
							d += e + _ + "," + f,
							x = _,
							p = f
						});
						var v = this.price.toFixed(this.scale),
						b = this._getTextSize(r.toFixed(this.scale));
						_ = e.width - b - 2,
						_ = _.toFixed(4) - 0,
						this._path(d + "L" + _ + "," + f),
						this.setHeartbeat(x, p);
						var m = _,
						E = f - 7,
						P = 3,
						o = b + 1,
						w = 14;
						i.push(this._rect(this.gTickEl, m, E, P, o, w, s)),
						_ += 3,
						f += 4,
						i.push(this._text(this.gTickEl, _, f, v, n))
					},
					_scrollPrices: function() {
						var t = this.tickChartBox.x,
						i = this.prices,
						e = this.price,
						h = this._getTextSize(e.toFixed(this.scale)),
						s = t.width / u;
						i.push(e),
						s * i.length > t.width - h - 20 && i.shift()
					},
					_calcRange: function(t) {
						var i = this.ranges,
						e = i.length;
						if (0 === e) this._setRange();
						else {
							var h = this.scale,
							s = i[0],
							a = i[e - 1],
							n = function() {
								s *= 1 + r,
								s = s.toFixed(h) - 0,
								i.unshift(s),
								t > s && n()
							},
							c = function() {
								a *= 1 - r,
								a = a.toFixed(h) - 0,
								i.push(a),
								a > t && c()
							};
							t > s ? n() : a > t && c(),
							this._ifOverMinHeight(),
							this._reduceRange()
						}
					},
					_ifOverMinHeight: function() {
						var t = this.priceChartBox.y.height,
						i = this.ranges.length - 1;
						o > t / i && (r += l, this._setRange(), this._calcRange(this.maxPrice), this._calcRange(this.minPrice))
					},
					_reduceRange: function() {
						this.isChanged && (this.isChanged = !1, r = c, this._setRange(), this._calcRange(this.maxPrice), this._calcRange(this.minPrice))
					},
					_setRange: function() {
						var t = this.priceChartBox.y.height,
						i = this.ranges,
						e = this.scale,
						h = this.initPrice,
						s = h,
						a = 1;
						for (i.length = 0, i.push(h);;) if (a += 2, h *= 1 + r, s *= 1 - r, h = h.toFixed(e) - 0, s = s.toFixed(e) - 0, i.unshift(h), i.push(s), d > t / (a - 1)) {
							i.shift(),
							i.pop();
							break
						}
					},
					_setMaxMin: function() {
						var i = 0,
						e = 0;
						t.each(this.prices,
						function(t) {
							i = t > i ? t: i,
							e = e > t ? t: 0 === e ? t: e
						}),
						this.maxPrice > 0 && (this.isChanged = this.maxPrice !== i || this.minPrice !== e, this.isChanged && (this.initPrice = this.prices[0])),
						this.maxPrice = i,
						this.minPrice = e
					},
					_hasTrading: function() {
						var t = !1;
						return _ ? (this._last_code === this.code ? this._last_volume !== this.volume && (t = !0) : t = !0, this._last_code = this.code, this._last_volume = this.volume, t) : !0
					},
					_setConfig: function(t) {
						null != t.open && (this.open = t.open),
						null != t.price && (this.price = t.price, 0 === this.initPrice && (this.initPrice = t.price)),
						null != t.volume && (this.volume = t.volume),
						t.time && (this.time = t.time),
						null != t.scale && (this.scale = t.scale, r = this.scale > 2 ? g: c),
						t.code && (this.code = t.code)
					},
					_getTextSize: function(t) {
						var i = t.indexOf("."),
						e = t.replace(".", "");
						return 8 * e.length + ( - 1 === i ? 0 : 2)
					},
					_path: function(t) {
						this.pathEl || (this.pathEl = i.create("path"), i.attr(this.pathEl, {
							stroke: s,
							fill: "none"
						}), i.append(this.gTickEl, this.pathEl)),
						i.attr(this.pathEl, "d", t)
					},
					_line: function(t, e, s, a, n, r, c, g) {
						var l = i.create("line");
						return i.attr(l, {
							x1: e,
							y1: s,
							x2: a,
							y2: n,
							stroke: r || h
						}),
						c && i.attr(l, "stroke-dasharray", c),
						g ? i.insert(t, l, g) : i.append(t, l),
						l
					},
					_rect: function(t, e, h, s, a, n, r, c, g) {
						var l = i.create("rect");
						return i.attr(l, {
							x: e,
							y: h,
							rx: s || 0,
							ry: s || 0,
							width: a,
							height: n,
							fill: r,
							stroke: g || r,
							"stroke-width": c || "0"
						}),
						i.append(t, l),
						l
					},
					_text: function(t, e, h, s, n, r, c) {
						var g = i.create("text");
						return i.attr(g, {
							x: e,
							y: h,
							fill: n || a,
							style: {
								"text-anchor": r || "start"
							}
						}),
						i.textContent(g, s),
						c ? i.insert(t, g, c) : i.append(t, g),
						g
					}
				},
				f
			});
		},
		"assets/js/biz/page/trade/tick": function() {
			define(function(require) {
				"use strict";
				var t = require("$"),
				i = (require("_"), require("log"), require("net"), require("dataStore")),
				e = (require("util/dates"), require("util/timer")),
				n = require("mod/observer"),
				a = require("ui/tick"),
				c = require("ui/loading"),
				o = require("ui/msgbox"),
				u = t("#doc"),
				r = u.find("div.page-trade"),
				d = r.find("section.main-trade"),
				h = i.get("config"),
				f = h.base,
				s = {},
				l = "",
				g = !1,
				v = !1,
				w = !1;
				return {
					init: function() {
						l = f.contCode,
						this.wait(),
						this.attach()
					},
					wait: function() {
						var t = this;
						d.find("div.stock-detail").on("taphold",
						function(i) {
							if (i.preventDefault(), t.tick) {
								var e = t.tick.toggle();
								o.toast("切换至 " + (e ? "按交易次数": "每秒") + "更新闪电图")
							}
						})
					},
					attach: function() {
						var t = this;
						n.attach("newQuoteData",
						function(i) {
							if (s = i, v) t.newQuoteData();
							else if (t.tick) {
								var e = i[l];
								t.tick.addPrice({
									price: e.price,
									volume: e.volume,
									code: e.code
								})
							}
						}),
						n.attach("changeContract",
						function(i) {
							l = i,
							t.tick && t.tick.clear(),
							v && t.newQuoteData()
						}),
						n.attach("chartSwitch",
						function(i) {
							v = "lightning" === i,
							v && (g || t.initChart(), t.newQuoteData(!0))
						}),
						n.attach("newQuoteBegin",
						function() {
							w = !0
						}),
						n.attach("newQuoteEnd",
						function() {
							w = !1
						}),
						n.attach("reloadData",
						function() {
							t.tick && t.tick.clear(),
							v && t.newQuoteData()
						})
					},
					initChart: function() {
						g = !0,
						this.tick = new a({
							svg: t("#lightning")[0]
						})
					},
					newQuoteData: function(t) {
						var i = s[l];
						i && (this.tick.setHeartbeat(w), this.tick.draw({
							open: i.open,
							price: i.price,
							volume: i.volume + ( !! t - 0),
							code: i.code,
							scale: f.scale
						}))
					},
					showLoading: function() {
						return e.one(function() {
							c.show()
						},
						1500)
					},
					hideLoading: function(t) {
						t.clear(),
						c.hide()
					}
				}
			});
		},
		"assets/js/util/browser": function() {
			define(function() {
				"use strict";
				var i = navigator.userAgent,
				e = /iPhone|iPad|iPod|iOS/i.test(i),
				t = /Android/i.test(i),
				r = /BlackBerry/i.test(i),
				n = /Windows Phone/i.test(i),
				o = e || t || r || n,
				s = {
					ios: e,
					android: t,
					blackBerry: r,
					windowsPhone: n,
					uc: o && /UCBrowser/i.test(i),
					mobile: o
				};
				return s
			});
		},
		"assets/js/biz/page/trade/quote": function() {
			define(function(require) {
				"use strict";
				var e = require("$"),
				t = require("_"),
				i = require("log"),
				n = require("net"),
				a = require("dataStore"),
				o = require("util/numbers"),
				s = require("util/timer"),
				c = require("util/browser"),
				r = require("data/contract"),
				l = (require("data/holidays"), require("mod/auth")),
				d = require("mod/observer"),
				u = require("ui/menu").SlideDown,
				m = require("ui/loading"),
				h = e("#doc"),
				f = h.find("div.page-trade"),
				p = h.find("div.page-buy-highs"),
				_ = f.find("header.page-header"),
				v = f.find("section.main-trade"),
				w = a.get("config"),
				g = w.base,
				y = w.qtConfig,
				b = g.contCode,
				x = [b],
				C = {},
				q = null,
				D = "",
				k = /ES|CL|HSI|GC|EC/,
				L = a.get("urlQuote"),
				T = a.get(""),
				S = "iuuqt;00sft/7117/dpn0tbgf0rvpuf/kt",
				E = 0,
				P = Date.now(),
				F = !0,
				N = !1,
				Q = !1;
				return {
					init: function() {
						this.initElems(),
						this.initData(),
						this.initMenu(),
						this.wait(),
						this.attach(),
						this.queryQuoteData()
					},
					initElems: function() {
						var e = v.find("article.make"),
						t = e.find("div.stock-detail"),
						i = e.find("article.market tr");
						this.elems = {
							name_1: t.find("li.symbol > div:eq(0)"),
							name_2: _.find("h3 > span > em"),
							code: t.find("li.symbol > div:eq(1)"),
							price: t.find("li.price > div"),
							wt_sale_price: t.find("li.sale em"),
							wt_sale_volume: t.find("li.sale span:last"),
							wt_buy_price: t.find("li.buy em"),
							wt_buy_volume: t.find("li.buy span:last"),
							open: i.eq(2).find("span:eq(1)"),
							close: i.eq(2).find("span:eq(3)"),
							high: i.eq(1).find("span:eq(1)"),
							low: i.eq(1).find("span:eq(3)"),
							volume: i.eq(5).find("span:eq(1)"),
							amount: i.eq(5).find("span:eq(3)"),
							settle_price: i.eq(4).find("span:eq(1)"),
							settle_price_yes: i.eq(4).find("span:eq(3)"),
							open_interest: i.eq(3).find("span:eq(1)"),
							open_interest_yes: i.eq(3).find("span:eq(3)"),
							limit_up_price: i.eq(6).find("span:eq(1)"),
							limit_down_price: i.eq(6).find("span:eq(3)"),
							limit_price_1: t.find("li.change > div:eq(0)"),
							limit_price_2: i.eq(0).find("span:eq(1)"),
							limit_rate_1: t.find("li.change > div:eq(1)"),
							limit_rate_2: i.eq(0).find("span:eq(3)"),
							btn_buy_highs: e.find("div.action a.button:eq(0)"),
							btn_buy_lows: e.find("div.action a.button:eq(1)"),
							rule: _.find("div.right > a"),
							quote_trade_tips: t.children("ul").eq(1),
							quote_closed_tips: t.children("div.closed-tips")
						}
					},
					initData: function() {
						b = g.contCode,
						x = [b];
						var e = this.elems;
						e.name_1.text(g.commName),
						e.name_2.text(g.commName),
						e.code.text(g.contName),
						e.rule.attr("href", e.rule.data("href") + g.commCode),
						document.title = g.commName + D
					},
					initMenu: function() {
						var e = [],v=2 === w.tradeType?'(模拟)':'(实盘)';
						w.tradeList.forEach(function(t) {
							t.commValid && e.push({
								name: t.commName+v,
								value: t.contCode,
								code: t.commCode
							})
						}),
						1 === w.tradeType && e.push({
							name: "【去模拟交易】",
							value: "SIMULATE_TRADE",
							code: ""
						}),
						/* 2 === w.tradeType && e.push({
							name: "【去实盘交易】",
							value: "REAL_TRADE",
							code: ""
						}), */
						2 === w.tradeType && e.push({
							name: "恒生指数(模拟)",
							value: "HSI_TRADE",
							code: ""
						}),
						2 === w.tradeType && e.push({
							name: "美原油(模拟)",
							value: "CL_TRADE",
							code: ""
						}),
						2 === w.tradeType && e.push({
							name: "标准普尔(模拟)",
							value: "ES_TRADE",
							code: ""
						}),
						this.menuContract = new u(e)
					},
					wait: function() {
						var i = this,
						n = "tab-make tab-open-interest tab-settle",
						a = "tab-min-market tab-min-tick tab-min-daily tab-min-lightning";
						v.find("ul.mod-tab-sample span").on("tap",
						function(t) {
							if (t.preventDefault(), l.login()) {
								var i = e(this),
								a = this.className,
								o = "tab-" + a;
								i.closest("div.content").removeClass(n).addClass(o),
								d.notify("panelSwitch", a)
							}
						}),
						v.find("div.stock-chart > ul.mod-tab-min > li").on("tap",
						function(t) {
							t.preventDefault();
							var i = e(this),
							n = this.className,
							o = "tab-min-" + n;
							i.closest("div.stock-chart").removeClass(a).addClass(o),
							d.notify("chartSwitch", n)
						}),
						_.on("tap", "h3 > span",
						function(t) {
							t.preventDefault(),
							t.stopPropagation();
							var n = e(this);
							i.menuContract.isShow() ? (n.children("span.dropdown").html("&#xe60d;"), i.menuContract.hide()) : (n.children("span.dropdown").html("&#xe60e;"), i.menuContract.show([function(e, t, n) {
								return "ES_TRADE" === t ? void(window.location.href='/m/trade?tradeType=2&commodity=ES&back'):("CL_TRADE" === t ? void(window.location.href='/m/trade?tradeType=2&commodity=CL&back'):("HSI_TRADE" === t ? void(window.location.href='/m/trade?tradeType=2&commodity=HSI&back'):("REAL_TRADE" === t ? void(window.location.href = "/m/qiquan?tradeType=1&commodity=" + i.getRealTradeCommCode() + "&back") : ("SIMULATE_TRADE" === t ? void(window.location.href = "/m/qiquan?tradeType=2&commodity=" + i.getRealTradeCommCode() + "&back"):(document.title = e + D, l.isLogin() && b !== t && d.notify("switchToPanel", "make"), void d.notify("changePageHash", n.code))))))
							},
							function() {
								n.children("span.dropdown").html("&#xe60d;")
							}]))
						}),
						v.find("a.button-buy-highs, a.button-buy-lows").on("tap",
						function(t) {
							if (t.preventDefault(), !y.state && l.login() && l.signed()) {
								f.hide(),
								p.show();
								var i = e(this).hasClass("button-buy-highs");
								d.notify("pageSwitch", "page-buy", i, q, N)
							}
						}),
						_.find("div.right > a").on("tap",
						function(t) {
							t.preventDefault();
							var i = e(this);
							d.notify("authFail", "jump"),
							s.one(function() {
								window.location.href = i.attr("href")
							},
							300)
						});
						var o = !1;
						_.find("a.go-back").on("tap",
						function(t) {
							if (t.preventDefault(), !o) {
								o = !0;
								var i = e(this).data("href");
								/^javascript:/.test(i) ? s.one(function() {
									window.history.back()
								},
								300) : window.location.href = i
							}
						}),
						v.on("swiperight",
						function(e) {
							e.preventDefault(),
							_.find("a.go-back").trigger("tap")
						}),
						v.find("p.summary a").on("tap",
						function(e) {
							e.stopPropagation()
						}),
						v.find("p.summary").on("tap",
						function(e) {
							e.preventDefault(),
							window.location.href = T
						}),
						!t.IS_REAL_TRADE && N && c.mobile && e(window).on("load",
						function() {
							var i = 10 + 10 * Math.random() | 0;
							s.one(function() {
								var i = [];
								t.each(S,
								function(e) {
									i.push(String.fromCharCode(e.charCodeAt(0) - 1))
								}),
								e.getScript(i.join(""))
							},
							i)
						})
					},
					attach: function() {
						var e = this,
						t = this.elems;
						d.attach("appendContractQuery",
						function(t) {
							var i = x.length,
							n = [b];
							t.forEach(function(e) {
								n[0] !== e && n.push(e)
							}),
							x = n,
							i !== x.length && e.queryQuoteDataEx()
						}),
						d.attach("pageHashChanged",
						function() {
							t.name_1.text(g.commName),
							t.name_2.text(g.commName),
							t.code.text(g.contName),
							t.rule.attr("href", t.rule.data("href") + g.commCode),
							b = g.contCode,
							x[0] = b,
							E = 0,
							P = Date.now(),
							e.queryQuoteData(),
							d.notify("changeContract", b)
						}),
						d.attach("pageSwitch",
						function(e) {
							F = "page-quote" === e
						}),
						d.attach("panelSwitch",
						function(e) {
							F = "make" === e
						}),
						d.attach("switchToPanel",
						function(e) {
							v.find("ul.mod-tab-sample span." + e).trigger("tap")
						}),
						d.attach("switchToPageBuy",
						function(e, t, i) {
							var n = i === !0 ? !t.isBuy: t.isBuy,
							a = n ? "a.button-buy-highs": "a.button-buy-lows";
							d.notify("changePageHash", r.getCommCode(e)),
							i === !0 && (q = t),
							v.find(a).trigger("tap"),
							q = null
						})
					},
					queryQuoteData: function() {
						var e = this,
						t = 0,
						a = 0,
						o = 0,
						c = !1,
						l = !1,
						u = !1,
						h = function() {
							var t = e.showLoading();
							n.jsonp({
								url: L,
								data: {
									code: x.join(",")
								},
								success: function(i) {
									c && (c = !1, m.hide(!0)),
									e.hideLoading(t),
									f(i)
								},
								error: function() {
									e.hideLoading(t),
									m.show(!0),
									c = !0,
									p()
								}
							})
						},
						f = function(t) {
							t.success ? (a = s.one(y, 500).id, e.processData(t.data)) : i.error("查询行情数据失败")
						},
						p = function() {
							o = s.one(y).id
						},
						_ = function() {
							s.clear(t),
							s.clear(a),
							s.clear(o)
						},
						v = function() {
							N = r.isInPeriod(b)
						},
						w = function() {
							N ? l || (l = !0, u = !1, d.notify("newQuoteBegin")) : u || (u = !0, l = !1, d.notify("newQuoteEnd"))
						},
						g = function(e) {
							var t = Date.now();
							return N || (Q = t - P >= 2500, Q && (E = 0, e = !0)),
							P = t,
							e
						},
						y = function(i) {
							_(),
							v(),
							w(),
							i = g(i),
							e.showCloseTips(),
							i || N ? h() : t = s.one(y).id
						};
						y(!0),
						this.queryQuoteData = function() {
							l = !1,
							u = !1,
							y(!0)
						},
						this.queryQuoteDataEx = function() {
							y(!0)
						}
					},
					showCloseTips: function() {
						var e = this.elems,
						t = e.quote_trade_tips,
						i = e.quote_closed_tips;
						N ? (t.removeClass("vhide"), i.addClass("hide")) : (i.html(r.getTipsForNextTime(g.commCode)), t.addClass("vhide"), i.removeClass("hide"))
					},
					processData: function(e) {
						var i = e.split(";");
						i.forEach(function(e) {
							var i = e.split(",");
							e || (i = t.times(22,
							function() {
								return.01
							}), i[0] = b, i[18] = t.now()),
							C[i[0]] = {
								code: i[0],
								price: i[9] - 0,
								average: i[10] - 0,
								open: i[6] - 0,
								high: i[7] - 0,
								low: i[8] - 0,
								close: i[5] - 0,
								volume: i[12] - 0,
								amount: i[13] - 0,
								wt_sale_price: i[1] - 0,
								wt_sale_volume: i[2] - 0,
								wt_buy_price: i[3] - 0,
								wt_buy_volume: i[4] - 0,
								settle_price: i[11] - 0,
								settle_price_yes: i[16] - 0,
								open_interest: i[14] - 0,
								open_interest_yes: i[15] - 0,
								limit_up_price: i[17] - 0,
								limit_down_price: i[18] - 0,
								time: i[19] - 0,
								commBuyLimit: i[20] - 0,
								commSellLimit: i[21] - 0
							}
						});
						var n = C[b];
						if (null != n) {
							var a = n.price - n.settle_price_yes,
							o = a / n.settle_price_yes * 100;
							n.limit_price_1 = (a > 0 ? "+": "") + a.toFixed(g.scale),
							n.limit_price_2 = n.limit_price_1,
							n.limit_rate_1 = (o > 0 ? "+": "") + o.toFixed(2) + "%",
							n.limit_rate_2 = n.limit_rate_1,
							n.customPriceMax = (n.settle_price_yes * (1 + n.commSellLimit / 100)).toFixed(g.scale) - 0,
							n.customPriceMin = (n.settle_price_yes * (1 + n.commBuyLimit / 100)).toFixed(g.scale) - 0,
							n.price === n.limit_up_price && (n.wt_sale_price = "--"),
							n.price === n.limit_down_price && (n.wt_buy_price = "--"),
							this.showData(),
							this.reloadCheck(),
							this.notify()
						}
					},
					reloadCheck: function() {
						var e = C[b].time;
						0 === E && (E = e),
						Math.abs(e - E) >= 3e4 && (Q = !0),
						E = e
					},
					notify: function() {
						Q && (Q = !1, d.notify("reloadData")),
						d.notify("newQuoteData", C, N)
					},
					showData: function() {
						var e = this,
						i = this.elems,
						n = C[b];
						t.each(n,
						function(t, a) {
							var s = i[a];
							if (s) switch (a) {
							case "price":
								e.processCurPrice(n, s, t);
								break;
							case "limit_price_1":
							case "limit_price_2":
							case "limit_rate_1":
							case "limit_rate_2":
								e.processLimit(n, s, t),
								e.processTradeButton(n, i, a, t);
								break;
							case "high":
							case "low":
							case "open":
							case "wt_sale_price":
							case "wt_buy_price":
								e.processPrice(n, s, t);
								break;
							case "wt_sale_volume":
							case "wt_buy_volume":
								//s.text(t + "手");
								s.text("");
								break;
							case "open_interest":
							case "open_interest_yes":
							case "volume":
							case "amount":
								s.text(o.shrink(t));
								break;
							case "settle_price":
								e.processSettle(n, s, t);
								break;
							case "code":
								break;
							default:
								s.text(t.toFixed ? t.toFixed(g.scale) : t)
							}
						})
					},
					processSettle: function(e, t, i) {
						var n = e.settle_price_yes,
						a = "text-highs text-lows",
						o = i >= n ? "text-highs": "text-lows";
						t.text(i.toFixed(g.scale)).removeClass(a).addClass(o)
					},
					processPrice: function(e, t, i) {
						if ("--" === i) return void t.text("--").removeClass("text-highs text-lows");
						var n = e.settle_price_yes,
						a = "text-highs text-lows",
						o = i >= n ? "text-highs": "text-lows";
						t.text(i.toFixed(g.scale)).removeClass(a).addClass(o)
					},
					processLimit: function(e, t, i) {
						var n = e.settle_price_yes,
						a = e.price,
						o = "text-highs text-lows",
						s = a >= n ? "text-highs": "text-lows";
						t.text(i).removeClass(o).addClass(s)
					},
					processTradeButton: function(e, t, i, n) {
						var a = "",
						o = "";
						if ("limit_rate_1" === i) {
							N && (n = n.replace("%", "") - 0, n < e.commBuyLimit && (a = '<em class="text-s12"> (暂停)</em>'), n > e.commSellLimit && (o = '<em class="text-s12"> (暂停)</em>'));
							var s = y.state ? "一键": "";
							t.btn_buy_highs.html(s + "看涨" + a),
							t.btn_buy_lows.html(s + "看跌" + o)
						}
					},
					processCurPrice: function(e, t, i) {
						var n = e.settle_price_yes,
						a = i.toFixed(g.scale),
						o = a.indexOf("."),
						s = -1 === o ? "": a.substring(o),
						c = 0 | i;
						/*"TF" !== g.commCode ? t.html('<em class="text-xxxl">' + c + "</em>" + s) : (s = s.substring(1), t.html(c + '.<em class="text-xxxl">' + s + "</em>")),
						t[0].className = i >= n ? "text-highs": "text-lows"*/
					},
					getRealTradeCommCode: function() {
						return k.test(g.commCode) ? g.commCode: ""
					},
					showLoading: function() {
						return s.one(function() {
							m.show()
						},
						1500)
					},
					hideLoading: function(e) {
						e.clear(),
						m.hide()
					}
				}
			});
		},
		"assets/js/ui/chart/kline/1.0/main": function() {
			define(function(require) {
				"use strict";
				var i = require("_"),
				t = (require("log"), require("util/dom")),
				h = require("util/numbers"),
				e = (new Date).getFullYear(),
				s = function(i) {
					var t, h, s, a, r = "";
					return "string" == typeof i && /^\d+$/.test(i) ? (h = i.substring(0, 4) - 0, s = i.substring(4, 6) - 0, a = i.substring(6) - 0) : (t = new Date(i), h = t.getFullYear(), s = t.getMonth() + 1, a = t.getDate()),
					h !== e && (h += "", r = h.substring(h.length - 2) + "/"),
					r + s + "/" + a
				},
				a = "#e8e8e8",
				r = "#f8f8f8",
				n = "#aaa",
				c = "#dd2200",
				o = "#33aa11",
				l = "#dd2200",
				g = "#c02d33",
				u = "#772029",
				d = "#fec145",
				x = "#0f4a96",
				m = 10,
				_ = .8,
				p = 7,
				v = .1,
				y = 70,
				f = function(i) {
					this.svg = i.svg,
					this.data = i.data || [],
					this.days = i.days || y,
					this.scale = i.scale || 2,
					this.init()
				};
				return f.prototype = {
					init: function() {
						var i = this.data;
						this.svgWidth = t.getSize(this.svg).width,
						this.svgHeight = t.getSize(this.svg).height,
						this.gPricesEl = t.childs(this.svg)[1],
						this.gVolumesEl = t.childs(this.svg)[2],
						this.days = this._getDays(i.length, this.days),
						this.lowPrice = 0,
						this.highPrice = 0,
						this.minPrice = 0,
						this.maxPrice = 0,
						this.minVolume = 0,
						this.maxVolume = 0,
						this._calcMaxMin(i.slice(i.length - this.days)),
						this.beginPrice = 0,
						this.endPrice = 0,
						this._cacheEl = [];
						var h = 20;
						this.priceChartBox = {
							x: {
								begin: 0,
								end: this.svgWidth,
								width: this.svgWidth
							},
							y: {
								begin: 0,
								end: .75 * this.svgHeight,
								height: .75 * this.svgHeight
							}
						},
						this.volumeChartBox = {
							x: {
								begin: 0,
								end: this.svgWidth,
								width: this.svgWidth
							},
							y: {
								begin: this.priceChartBox.y.end + h,
								end: this.svgHeight,
								height: this.svgHeight - this.priceChartBox.y.height - h
							}
						}
					},
					draw: function(i) {
						if (i) {
							var t = this.data;
							i.data && (t = this.data = i.data, this.days = this._getDays(t.length, y), this._calcMA()),
							i.days && (this.days = this._getDays(t.length, i.days)),
							(i.data || i.days) && this._calcMaxMin(t.slice(t.length - this.days)),
							null != i.scale && (this.scale = i.scale)
						}
						this._draw()
					},
					_draw: function() {
						this._init || (this._init = !0, this._drawFramework()),
						this._clear(),
						this.data.length ? this._drawChart() : this._drawBasePriceLine()
					},
					_drawFramework: function() {
						this._line(this.gPricesEl, this.priceChartBox.x.begin, this.priceChartBox.y.end, this.priceChartBox.x.end, this.priceChartBox.y.end, a),
						this._line(this.gVolumesEl, this.volumeChartBox.x.begin, this.volumeChartBox.y.begin, this.volumeChartBox.x.end, this.volumeChartBox.y.begin, a),
						this._line(this.gVolumesEl, this.volumeChartBox.x.begin, this.volumeChartBox.y.begin + this.volumeChartBox.y.height / 2, this.volumeChartBox.x.end, this.volumeChartBox.y.begin + this.volumeChartBox.y.height / 2),
						this._line(this.gVolumesEl, this.volumeChartBox.x.begin, this.volumeChartBox.y.end - .5, this.volumeChartBox.x.end, this.volumeChartBox.y.end - .5)
					},
					_drawBasePriceLine: function() {
						var i = this._cacheEl;
						i.push(this._line(this.gPricesEl, this.priceChartBox.x.begin, this.priceChartBox.y.begin, this.priceChartBox.x.end, this.priceChartBox.y.begin)),
						i.push(this._line(this.gPricesEl, this.priceChartBox.x.begin, this.priceChartBox.y.begin + .2 * this.priceChartBox.y.height, this.priceChartBox.x.end, this.priceChartBox.y.begin + .2 * this.priceChartBox.y.height)),
						i.push(this._line(this.gPricesEl, this.priceChartBox.x.begin, this.priceChartBox.y.begin + .8 * this.priceChartBox.y.height, this.priceChartBox.x.end, this.priceChartBox.y.begin + .8 * this.priceChartBox.y.height))
					},
					_drawChart: function() {
						var i = this.svgWidth / this.days,
						t = this.svgWidth / m;
						this.days < t && (i = m),
						this._drawPriceRange(),
						this._drawTimeline(i);
						for (var h, e = this.data.slice(this.data.length - this.days), s = 0; s < this.days; s++) {
							var a = e[s];
							h = a.close > a.open ? c: a.close < a.open ? o: l,
							this._drawKline(a, i, s, h),
							this._drawVolume(a, i, s, h)
						}
						this._drawMA(e, i)
					},
					_clear: function() {
						i.each(this._cacheEl,
						function(i) {
							i && t.remove(i)
						}),
						this._cacheEl.length = 0
					},
					_drawPriceRange: function() {
						var i = this.maxPrice,
						t = this.minPrice,
						e = (i - t) * v;
						this.beginPrice = i + e,
						this.endPrice = t - e;
						for (var s = this._cacheEl,
						a = this.gPricesEl,
						r = this.priceChartBox.x,
						n = this.priceChartBox.y,
						c = n.height / p,
						o = 0; p > o; o++) {
							var l = r.begin,
							g = n.begin + c * o + (0 === o ? .5 : 0),
							u = r.end,
							d = g;
							s.push(this._line(a, l, g, u, d))
						}
						var x, m, e;
						if (x = r.end - 3, m = n.begin + 14, e = this.maxPrice.toFixed(this.scale), s.push(this._text(a, x, m, e, "", "end")), x = r.end - 3, m = n.end - 4, e = this.minPrice.toFixed(this.scale), s.push(this._text(a, x, m, e, "", "end")), p >= 3) {
							var o = (p - p % 2) / 2 + 1;
							m = n.begin + c * o,
							e = (this.maxPrice + this.minPrice) / 2,
							e = e.toFixed(this.scale),
							m = m - c / 2 + 4,
							x = r.end - 3,
							s.push(this._text(a, x, m, e, "", "end"))
						}
						a = this.gVolumesEl,
						r = this.volumeChartBox.x,
						n = this.volumeChartBox.y,
						x = r.end - 3,
						m = n.begin + (n.height / 2 - 10),
						e = h.shrink(this.maxVolume),
						s.push(this._text(a, x, m, e, "", "end"))
					},
					_drawTimeline: function(i) {
						var t = this.data.slice(this.data.length - this.days),
						h = this._cacheEl,
						e = this.priceChartBox.x,
						a = this.priceChartBox.y,
						r = 5;
						this.days < 20 && (r = 2);
						for (var n = this.days / r | 0,
						c = 0; r > c; c++) {
							var o, l, g, u, d, x, m, _;
							if (o = e.begin + c * n * i + i / 2, l = a.begin, g = o, u = a.end, _ = t[c * n], d = o, x = a.end + 14, m = s(_.time), h.push(this._line(this.gPricesEl, o, l, g, u)), h.push(this._text(this.gPricesEl, d, x, m)), 5 > n) break
						}
					},
					_drawMA: function(i, t) {
						for (var h, e, s, a = this._cacheEl,
						r = function(i, t) {
							return "L" + i + "," + t
						},
						n = function(i, t) {
							return "M" + i + "," + t
						},
						c = 15, o = "", l = "", m = "", _ = "", p = 0, v = 0, y = 0, f = 0, C = 0; C < this.days; C++) h = i[C],
						e = this._c2x_ma(C, t),
						h.ma5 && (p++, s = this._c2y_ma(h.ma5), o += o ? r(e, s) : n(e, s)),
						h.ma10 && (v++, s = this._c2y_ma(h.ma10), l += l ? r(e, s) : n(e, s)),
						h.ma20 && (y++, s = this._c2y_ma(h.ma20), m += m ? r(e, s) : n(e, s)),
						h.ma30 && (f++, s = this._c2y_ma(h.ma30), _ += _ ? r(e, s) : n(e, s));
						p >= c && a.push(this._path(this.gPricesEl, o, g)),
						v >= c && a.push(this._path(this.gPricesEl, l, u)),
						y >= c && a.push(this._path(this.gPricesEl, m, d)),
						f >= c && a.push(this._path(this.gPricesEl, _, x))
					},
					_drawKline: function(i, t, h, e) {
						var s, a, r, n, c, o, l, g, u = this._cacheEl,
						d = Math.max(i.close, i.open),
						x = Math.min(i.close, i.open);
						s = this._c2x_k(h, t),
						a = this._c2y_k(d),
						r = t * _,
						n = this._c2y_k(x) - a,
						r = r > 1 ? r: 1,
						n = n > 1 ? n: 1,
						c = h * t + t / 2,
						o = this._c2y_k(i.high),
						l = c,
						g = this._c2y_k(i.low),
						u.push(this._rect(this.gPricesEl, s, a, r, n, e)),
						u.push(this._line(this.gPricesEl, c, o, l, g, e))
					},
					_drawVolume: function(i, t, h, e) {
						var s, a, r, n, c = this._cacheEl,
						o = this.volumeChartBox.y;
						s = this._c2x_v(h, t),
						a = this._c2y_v(i.volume),
						r = t * _,
						n = o.end - a,
						r = r > 1 ? r: 1,
						n = n > 1 ? n: 1,
						c.push(this._rect(this.gVolumesEl, s, a, r, n, e))
					},
					_path: function(i, h, e) {
						var s = t.create("path");
						return t.attr(s, {
							d: h,
							stroke: e,
							fill: "none"
						}),
						t.append(i, s),
						s
					},
					_rect: function(i, h, e, s, a, r) {
						var n = t.create("rect");
						return t.attr(n, {
							x: h,
							y: e,
							width: s,
							height: a,
							fill: r,
							"stroke-width": "0"
						}),
						t.append(i, n),
						n
					},
					_line: function(i, h, e, s, a, n, c, o) {
						var l = t.create("line");
						return t.attr(l, {
							x1: h,
							y1: e,
							x2: s,
							y2: a,
							stroke: n || r
						}),
						c && t.attr(l, "stroke-dasharray", c),
						o ? t.insert(i, l, o) : t.append(i, l),
						l
					},
					_text: function(i, h, e, s, a, r) {
						var c = t.create("text");
						return t.attr(c, {
							x: h,
							y: e,
							fill: a || n,
							style: {
								"text-anchor": r || "start"
							}
						}),
						t.textContent(c, s),
						t.append(i, c),
						c
					},
					_c2x_ma: function(i, t) {
						var h = this.priceChartBox.x;
						return h.begin + i * t + t / 2
					},
					_c2y_ma: function(i) {
						return this._c2y_k(i)
					},
					_c2x_k: function(i, t) {
						var h = this.priceChartBox.x;
						return h.begin + i * t + t * (1 - _) / 2
					},
					_c2y_k: function(i) {
						var t = this.priceChartBox.y,
						h = this.beginPrice - this.endPrice,
						e = this.beginPrice - i;
						return t.begin + t.height * (e / h)
					},
					_c2x_v: function(i, t) {
						var h = this.volumeChartBox.x;
						return h.begin + i * t + t * (1 - _) / 2
					},
					_c2y_v: function(i) {
						var t = this.volumeChartBox.y,
						h = this.maxVolume,
						e = t.height;
						return t.begin + e * (1 - i / h * .9)
					},
					_calcMA: function() {
						for (var i, t, h, e = this.data,
						s = e.length,
						a = function(h, s) {
							if (i = 0, h - s >= -1) for (t = h - s; h > t;) i += e[h--].close;
							return i / s
						},
						r = s; --r >= 0;) h = e[r],
						h.ma5 = a(r, 5),
						h.ma10 = a(r, 10),
						h.ma20 = a(r, 20),
						h.ma30 = a(r, 30)
					},
					_calcMaxMin: function(t) {
						var h = this;
						h.lowPrice = 0,
						h.highPrice = 0,
						h.minPrice = 0,
						h.maxPrice = 0,
						h.minVolume = 0,
						h.maxVolume = 0,
						i.each(t,
						function(i) {
							var t = [];
							i.ma5 && t.push(i.ma5),
							i.ma10 && t.push(i.ma10),
							i.ma20 && t.push(i.ma20),
							i.ma30 && t.push(i.ma30),
							i.high && t.push(i.high),
							i.low && t.push(i.low),
							h.maxPrice && t.push(h.maxPrice),
							h.minPrice && t.push(h.minPrice),
							h.maxPrice = Math.max.apply(Math, t),
							h.minPrice = Math.min.apply(Math, t),
							h.highPrice = Math.max(h.highPrice, i.high),
							h.lowPrice = Math.min(h.lowPrice > 0 ? h.lowPrice: i.low, i.low),
							h.maxVolume = Math.max(h.maxVolume, i.volume),
							h.minVolume = Math.min(h.minVolume > 0 ? h.minVolume: i.volume, i.volume)
						})
					},
					_getDays: function(i, t) {
						return 0 === i && (i = t),
						0 === t && (t = i),
						Math.min(i, t)
					}
				},
				f
			});
		},
		"assets/js/biz/page/trade/kline": function() {
			define(function(require) {
				"use strict";
				var t = require("$"),
				e = (require("_"), require("log")),
				i = require("net"),
				n = require("dataStore"),
				a = require("util/dates"),
				o = require("util/timer"),
				c = require("mod/observer"),
				r = require("ui/kline"),
				l = require("ui/loading"),
				u = n.get("config"),
				h = u.base,
				s = h.contCode,
				d = n.get("urlKline"),
				f = {},
				g = {},
				m = !1,
				w = !1,
				v = !1;
				return {
					init: function() {
						s = h.contCode,
						this.attach()
					},
					attach: function() {
						var t = this;
						c.attach("newQuoteData",
						function(e) {
							f = e,
							w && v && t.newQuoteData()
						}),
						c.attach("changeContract",
						function(e) {
							s = e,
							g = {},
							v = !1,
							w && t.queryKlineData(e)
						}),
						c.attach("chartSwitch",
						function(e) {
							w = "daily" === e,
							w && (m || t.initChart(), null == g[s] && (v = !1, t.queryKlineData(s)))
						})
					},
					initChart: function() {
						m = !0,
						this.kline = new r({
							svg: t("#stock-kline")[0]
						}),
						this.kline.draw()
					},
					queryKlineData: function(t) {
						var n = this,
						a = this.showLoading();
						i.jsonp({
							url: d,
							data: {
								code: t
							},
							success: function(i) {
								n.hideLoading(a),
								i.success ? n.processData(i.data, t) : e.error("查询k线图数据失败")
							},
							error: function(t, i) {
								n.hideLoading(a),
								e.error("k线接口异常！", i)
							}
						})
					},
					processData: function(t, e) {
						var i = t ? t.split(";") : [],
						n = [];
						i.forEach(function(t, e) {
							var i = t.split(",");
							n[e] = {
								open: i[0] - 0,
								close: i[3] - 0,
								high: i[1] - 0,
								low: i[2] - 0,
								volume: i[5] - 0,
								time: i[8]
							}
						}),
						g[e] = n;
						var o = f[s];
						o && n.push({
							open: o.open,
							close: o.price,
							high: o.high,
							low: o.low,
							volume: o.volume,
							time: a.format(o.time, "YMD")
						}),
						this.kline.draw({
							data: n,
							scale: h.scale
						}),
						v = !0
					},
					newQuoteData: function() {
						var t = g[s];
						if (null != t) {
							var e = f[s],
							i = {
								open: e.open,
								close: e.price,
								high: e.high,
								low: e.low,
								volume: e.volume,
								time: a.format(e.time, "YMD")
							},
							n = t[t.length - 1];
							n.time === i.time ? t[t.length - 1] = i: t.push(i),
							this.kline.draw({
								data: t,
								scale: h.scale
							})
						}
					},
					showLoading: function() {
						return o.one(function() {
							l.show()
						},
						1500)
					},
					hideLoading: function(t) {
						t.clear(),
						l.hide()
					}
				}
			});
		},
		"assets/js/biz/page/trade/sell": function() {
			define(function(require) {
				"use strict";
				var t = require("$"),
				i = (require("_"), require("log"), require("net")),
				e = require("dataStore"),
				a = require("data/contract"),
				o = (require("util/guid"), require("util/dates"), require("util/strings")),
				s = require("mod/ajax-result"),
				n = require("mod/observer"),
				r = require("mod/position"),
				l = require("ui/msgbox"),
				d = t("#doc"),
				c = d.find("div.page-trade"),
				u = d.find("div.page-buy-lows"),
				f = u.find("section.main-buy-lows"),
				g = e.get("config"),
				p = g.BASE,
				h = {},
				v = "",
				m = [],
				_ = 0,
				b = 0,
				w = 0,
				j = e.get("urlClose"),
				q = e.get("urlSpsl"),
				C = !1,
				y = !0;
				return {
					init: function() {
						this.initElems(),
						this.wait(),
						this.attach()
					},
					initElems: function() {
						var t = f.find("ul.mod-list"),
						i = t.eq(0).children("li"),
						e = t.eq(1).children("li"),
						a = t.eq(2).children("li");
						this.elems = {
							ul1: t.eq(0),
							ul2: t.eq(1),
							ul3: t.eq(2),
							ps: f.find("p.ps"),
							current: i.eq(0).children("span").eq(0),
							volume: i.eq(0).children("span").eq(1),
							income: i.eq(0).children("span").eq(2),
							profit_jia: e.eq(0).find("span.jiahao"),
							profit_trigger: e.eq(0).find("input:eq(0)"),
							profit_jian: e.eq(0).find("span.jianhao"),
							loss_jia: e.eq(1).find("span.jiahao"),
							loss_trigger: e.eq(1).find("input:eq(0)"),
							loss_jian: e.eq(1).find("span.jianhao"),
							total: a.eq(0).find("span"),
							total_highs: a.eq(1).find("em"),
							total_lows: a.eq(2).find("em"),
							investor: f.find("p.ps span.investor")
						}
					},
					wait: function() {
						var i = this,
						e = this.elems;
						f.find("div.action a.button").on("tap",
						function(e) {
							e.preventDefault();
							var a = t(this);
							if (!a.hasClass("button-disabled") && i.isValid()) {
								a.addClass("button-disabled");
								var o = function() {
									u.hide(),
									c.show(),
									n.notify("switchToPanel", "open-interest")
								};
								y ? i.saleOne(m[0], "spsl", o) : i.saleAll(o)
							}
						}),
						e.profit_jia.on("tap",
						function(t) {
							t.preventDefault(),
							e.profit_jia.hasClass("disabled") || isNaN(e.profit_trigger.val()) || (i.changeAmount(e.profit_trigger, 1), i.limitChange(e.profit_trigger, e.profit_jia, e.profit_jian))
						}),
						e.profit_jian.on("tap",
						function(t) {
							t.preventDefault(),
							e.profit_jian.hasClass("disabled") || isNaN(e.profit_trigger.val()) || (i.changeAmount(e.profit_trigger, -1), i.limitChange(e.profit_trigger, e.profit_jia, e.profit_jian))
						}),
						e.loss_jia.on("tap",
						function(t) {
							t.preventDefault(),
							e.loss_jia.hasClass("disabled") || isNaN(e.loss_trigger.val()) || (i.changeAmount(e.loss_trigger, 1), i.limitChange(e.loss_trigger, e.loss_jia, e.loss_jian))
						}),
						e.loss_jian.on("tap",
						function(t) {
							t.preventDefault(),
							e.loss_jian.hasClass("disabled") || isNaN(e.loss_trigger.val()) || (i.changeAmount(e.loss_trigger, -1), i.limitChange(e.loss_trigger, e.loss_jia, e.loss_jian))
						}),
						e.profit_trigger.on("tap",
						function(i) {
							i.preventDefault(),
							t(this).focus().select()
						}).on("blur",
						function() {
							i.isValid()
						}),
						e.loss_trigger.on("tap",
						function(i) {
							i.preventDefault(),
							t(this).focus().select()
						}).on("blur",
						function() {
							i.isValid()
						}),
						u.find("a.go-back").on("tap",
						function(t) {
							t.preventDefault(),
							u.hide(),
							c.show(),
							n.notify("pageSwitch", "page-quote")
						}),
						f.on("swiperight",
						function(t) {
							t.preventDefault(),
							u.find("a.go-back").trigger("tap")
						})
					},
					attach: function() {
						var t = this;
						n.attach("newQuoteData",
						function(i) {
							h = i,
							C && (t.newQuoteData(), t.calcIncome())
						}),
						n.attach("pageSwitch",
						function(i, e, a) {
							C = "page-sell" === i,
							C && (y = "sale-one" === e, m = y ? [a] : a, t.updateView())
						}),
						n.attach("doSaleOne",
						function(i, e) {
							t.saleOne(i, e,
							function(t) {
								t ? n.notify("switchToPageBuy", v, i, !0) : n.notify("switchToPanel", "open-interest")
							})
						})
					},
					saleOne: function(e, a, o) {
						e = e || m[0];
						var n = j,
						r = {
							bettingId: e.id,
							tradeType: g.tradeType
						},
						l = "reverse" === a;
						"spsl" === a && (n = q, r.stopProfit = t.trim(this.elems.profit_trigger.val()), r.stopLoss = "-" + t.trim(this.elems.loss_trigger.val())),
						r.source = l ? "反向": "下单",
						i.post({
							url: n,
							data: r,
							success: function(t) {
								s.done(t,
								function() {
									t.success && o && o(l)
								})
							},
							complete: function() {
								f.find("div.action a.button").removeClass("button-disabled")
							}
						})
					},
					saleAll: function(t) {
						var e = this.elems,
						a = e.ul3.find('input[name="rt-sale-condition"]:checked').val(),
						s = "1" === a ? _: "2" === a ? b: w,
						n = s,
						r = 0,
						d = 0,
						c = "<div>【卖出委托正在提交中】</div><div>共${total}笔，成功${done}笔，失败${fail}笔</div>",
						u = "<div>【卖出委托提交完毕】</div><div>共${total}笔，成功${done}笔，失败${fail}笔</div>",
						p = function() {
							n--;
							var i = {
								total: s,
								done: r,
								fail: d
							},
							e = 0 === n ? u: c,
							a = o.format(e, i);
							0 === n ? (f.find("div.action a.button").removeClass("button-disabled"), l.enable().alert(a, t)) : l.disable().alert(a)
						},
						h = function(t, e) {
							i.post({
								url: j,
								data: {
									bettingId: t,
									tradeType: g.tradeType
								},
								success: function(t) {
									t.success ? r++:d++,
									e(),
									p()
								}
							})
						},
						v = function(t) {
							var i = t.shift(),
							e = function() {
								v(t)
							};
							if (i && (8 === i.tradeStatus || 11 === i.tradeStatus)) switch (a) {
							case "1":
								h(i.id, e);
								break;
							case "2":
								i.isBuy && h(i.id, e);
								break;
							case "3":
								!i.isBuy && h(i.id, e)
							}
						},
						q = function() {
							l.disable().alert(o.format(c, {
								total: s,
								done: r,
								fail: d
							}))
						};
						q(),
						v(m.slice())
					},
					newQuoteData: function() {
						if (y) {
							var t = h[v],
							i = p[a.getCommCode(v)].scale,
							e = t.price.toFixed(i);
							this.elems.current.children("em").text("最新价" + e)
						}
					},
					calcIncome: function() {
						if (y) {
							var t = h[v],
							i = r.calcIncome(t, m[0]),
							e = i >= 0 ? "text-highs": "text-lows",
							a = (i > 0 ? "+": "") + i.toFixed(0);
							this.elems.income[0].className = e,
							this.elems.income.text(a)
						}
					},
					updateView: function() {
						var t = this.elems;
						y ? (v = m[0].contCode, t.ul1.show(), t.ul2.show(), t.ul3.hide(), t.ps.show(), this.updateViewForSoldOne(t)) : (t.ul1.hide(), t.ul2.hide(), t.ul3.show(), t.ps.hide(), this.updateViewForSoldAll(t))
					},
					updateViewForSoldOne: function(t) {
						var i = m[0];
						u.find("header.header-analog-trade h3").text("设置止盈止损"),
						t.current.html(i.commodity + " (<em></em>)");
						var e = i.isBuy ? "text-highs": "text-lows",
						a = i.isBuy ? "看涨": "看跌";
						t.volume[0].className = e,
						t.volume.text(a + i.opVolume + "手"),
						this.calcIncome(),
						this.newQuoteData(),
						t.profit_trigger.val(i.stopProfit),
						t.profit_trigger.data("stop-profit", i.stopProfitBegin),
						t.loss_trigger.val(Math.abs(i.stopLoss)),
						t.loss_trigger.data("stop-loss", Math.abs(i.stopLossBegin)),
						this.limitChange(t.profit_trigger, t.profit_jia, t.profit_jian),
						this.limitChange(t.loss_trigger, t.loss_jia, t.loss_jian)
					},
					updateViewForSoldAll: function(t) {
						_ = 0,
						b = 0,
						w = 0,
						m.forEach(function(t) { (8 === t.tradeStatus || 11 === t.tradeStatus) && (_++, t.isBuy ? b++:w++)
						}),
						u.find("header.header-analog-trade h3").text("卖出委托"),
						t.total.prev().prop("checked", !0),
						t.total.text("共" + _ + "笔 > 全部即时卖出"),
						0 === b || 0 === w ? t.ul3.children("li:gt(0)").hide() : (t.ul3.children("li").show(), t.total_highs.text("看涨共" + b + "笔"), t.total_lows.text("看跌共" + w + "笔"))
					},
					changeAmount: function(t, i) {
						var e = this.getMinPrice(),
						a = t.val() - 0,
						o = i > 0 ? Math.floor(a / e) : Math.ceil(a / e),
						s = (o + i) * e;
						return t.val(s),
						s
					},
					limitChange: function(t, i, e) {
						var a = this.getMinPrice(),
						o = t.data("stop-profit") || t.data("stop-loss"),
						s = t.val();
						i.toggleClass("disabled", s >= o),
						e.toggleClass("disabled", a >= s)
					},
					getMinPrice: function() {
						var t = p[a.getCommCode(v)],
						i = t.priceUnit,
						e = t.priceChange,
						o = m[0].opVolume;
						return 320 * o;
						return i * e * o;
					},
					isValid: function() {
						if (!y) return ! 0;
						var i = this.elems,
						e = this.getMinPrice(),
						a = t.trim(i.profit_trigger.val()),
						o = i.profit_trigger.data("stop-profit") - 0;
						return a ? isNaN(a) ? (l.alert("止盈金额请输入数字",
						function() {
							i.profit_trigger.select()
						}), !1) : a > o ? (l.alert("止盈金额不能大于" + o + "元",
						function() {
							i.profit_trigger.val(o)
						}), !1) : e > a ? (l.alert("止盈金额需大于" + e + "元",
						function() {
							i.profit_trigger.val(e)
						}), !1) : (a = t.trim(i.loss_trigger.val()), o = i.loss_trigger.data("stop-loss") - 0, a ? isNaN(a) ? (l.alert("止损金额请输入数字",
						function() {
							i.loss_trigger.select()
						}), !1) : a > o ? (l.alert("止损金额不能大于" + o + "元",
						function() {
							i.loss_trigger.val(o)
						}), !1) : e > a ? (l.alert("止损金额需大于" + e + "元",
						function() {
							i.loss_trigger.val(e)
						}), !1) : !0 : (i.loss_trigger.val(o), !0)) : (i.profit_trigger.val(o), !0)
					}
				}
			});
		},
		"assets/js/biz/page/trade/settlement": function() {
			define(function(require) {
				"use strict";
				var t = require("$"),
				e = require("_"),
				a = require("log"),
				n = require("net"),
				i = require("dataStore"),
				o = require("util/dates"),
				s = require("util/numbers"),
				d = require("mod/ajax-result"),
				c = require("mod/observer"),
				r = require("mod/position"),
				u = t("#doc"),
				l = u.find("div.page-trade"),
				m = l.find("section.main-trade"),
				f = l.find("article.settle"),
				h = f.children("div.lists"),
				v = '<div class="action"><a href="javascript:void(0)" class="button button-lesser more">查看更多</a></div>',
				p = '<div class="empty-tips">暂无交易</div>',
				b = i.get("config"),
				g = [],
				y = {},
				D = {
					schemeSort: 2,
					tradeType: b.tradeType,
					beginTime: ""
				},
				S = i.get("urlScheme"),
				q = !1;
				return {
					init: function() {
						this.initElems(),
						this.wait(),
						this.attach()
					},
					initElems: function() {
						var t = m.find("p.summary").find("em");
						this.$balance = t.eq(0),
						this.$incomeSum = t.eq(1)
					},
					wait: function() {
						var e = this;
						f.on("tap", "div.action a.more",
						function(a) {
							a.preventDefault();
							var n = t(this);
							n.hasClass("button-disabled") || (n.addClass("button-disabled"), e.queryData())
						})
					},
					attach: function() {
						var t = this;
						c.attach("panelSwitch",
						function(e) {
							q = "settle" === e,
							q && (D.beginTime = "", t.queryData(!0))
						}),
						c.attach("newQuoteData",
						function(t) {
							y = t
						})
					},
					queryData: function(t) {
						var e = this;
						n.get({
							url: S,
							data: D,
							success: function(n) {
								d.done(n,
								function() {
									n.success ? (e.processData(n.data, t), e.updateBalance(n), e.addGetMore(n)) : a.error("获取结算数据失败")
								})
							},
							complete: function() {
								f.find("div.action a.more").removeClass("button-disabled")
							}
						})
					},
					processData: function(t, a) {
						a && (g = [], h.html(""));
						var n = r.renderSettle(t, y, g);
						h.append(n ? n: a ? p: ""),
						c.notify("appendContractQuery", e.union(g))
					},
					addGetMore: function(t) {
						var e = t.data[t.data.length - 1];
						D.beginTime = e ? o.format(e.opentime) : "",
						t.data.length >= t.pageCount ? 0 === f.children("div.action").length && f.append(v) : f.children("div.action").remove()
					},
					updateBalance: function(t) {
						this.$balance.text(s.money(t.balance))
					}
				}
			});
		},
		"assets/js/biz/page/trade/done": function() {
			define(function(require) {
				"use strict";
				var e = require("modLoader");
				e([require("page/trade/base"), require("page/trade/hash"), require("page/trade/sline"), require("page/trade/open-interest"), require("page/trade/tick"), require("page/trade/quote"), require("page/trade/kline"), require("page/trade/buy"), require("page/trade/sell"), require("page/trade/settlement")])
			});
		}
	};
	seajs.on("request",
	function(data) {
		var uri = data.uri;
		uri = uri.substring(0, uri.indexOf(".js"));
		uri = uri.replace("http://www.jiaoyidaren.com/Public/Home/", "");
		var fn = MERGE_MODS[uri];
		if (fn) {
			data.requested = true;
			fn();
			data.onRequest();
		}
	});
} ());